Limiting the resources of Ubuntu

Limiting resources of specific processes under Ubuntu

On Ubuntu (and on most Linux distributions) you can easily prevent a program to consume all the power of the computer. Here's how:
If an application uses the CPU at 100%, this could block everything. You can limit the process with the cpu limit command. Open a terminal and type:

cpulimit -e process -l 40

In this example this "process" will be limited to 40% maximum.
You can also use the process PID (which can determine top):

cpulimit -p 130 -l 40

There the process with PID 130 would be limited to 40%.
We simply open the program then set the limit.
It may be that you have to install cpulimit before. Refer to your distribution for that. The official website is

  • If an application is using excessive disk drive, the system may crash, You can use the ionice command to solve this issue.
    • ionice -c3 PID 
  • This command reduces disk access priority of a process (defined by its PID).
  • We simply open the program then set the limit.
  • Again it must be installed if it is not. (official site?)

A good thing is to limit the bandwidth (upload and download).

  • The command to be used is trickle. Close program and then launch the command:
    • trickle -d 90 program
  • The program will be limited to 90Kbps for download. To limit upload, use the option "-u":
    • trickle -u 90 program
  • Here, the program is closed, and is limited from the start. To remove the limitation you must close and re-open it.
  • Again, you may need to install trickle if it is not set up by default.

If you want to download just a single file, you can use the basic but powerful wget:

wget --limit-rate=90k http//
Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Limiting the resources of Ubuntu », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (