How to limit cpu usage for a process with cpulimit (Ubuntu / Debian server)
|
|
cpulimit is a tool that can be used to limit cpu usage (throttle cpu usage) for a single process (by its PID). cpulimit is useful to ensure that a single process would not hogs the cpu cycles, which can be use by other processes. cpulimit is different from ‘nice’ as it limits the real cpu usage for a process, while ‘nice’ controls scheduling priorities for a particular process.
How to use cpulimit?
Basic usage:
cpulimit -p [pid] -l [ cpu percentage] cpulimit -p 12345 -l 25
Running cpulimit on background:
cpulimit -p 12345 -l 25 -z -b
Note: The cpu percentage is the same one as reported by the ‘top’ command.
cpulimit can be installed from Ubuntu and Debian 6.0 (Squeeze) repository through apt-get. The official website of cpulimit is http://limitcpu.sf.net
Tags: limit, nice, process, Server, usage
Keep updated with the latest posts, be a part of over 1,000 subscribers! :
Subscribe to your email
You might also want to read...
- Iptables rule to safeguard SSH server from crackers
- How to find cause of heavy usage on your Apache webserver
- How to limit MySQL port access to specific network
- Howto Speed Up Ubuntu Booting process
- CPU and Memory monitor on Ubuntu Panel and Unity on Ubuntu 11.04 Natty Narwhal
- How to secure server from SYN-flood attack using iptables
- Debian AMD64 is not limited to AMD machines only


Leave a Comment