Linux limits process CPU usage under Ubuntu

Source: Internet
Author: User
Tags cpu usage

Installing CPULimit
Install using source code
# cd/tmp
# wget ' http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz '
# tar cpulimit-1.1.tar.gz# CD cpulimit-1.1
# make
# CP cpulimit/usr/local/sbin/
# RM-RF CPULimit

*debian/ubuntu Users
More convenient installation with Apt-get

$ sudo apt-get update
$ sudo apt-get install CPULimit

How do I use CPULimit?
Restrict Firefox to use 30% CPU utilization

# CPULIMIT-E Firefox-l 30 Limit process number 1313 for programs using 30% CPU utilization

# cpulimit-p 1313-l 30 Find the PID method according to the process name

# PS aux | Less
# PS aux | grep Firefox
# pgrep-u Vivek PHP-CGI
# Pgrep LIGHTTPD can limit CPU utilization of processes using absolute paths

# cpulimit-p/opt/firefox/firebox-l 30 single-core CPUs and multi-core CPUs
The single-core CPU uses a range of 0%-100%, and the quad-core CPU uses a range of 0%-400%.

Related tools
Nice: Run the program at the specified priority level

Renice: Adjust the priority of the process to run

Linux limits process CPU usage under Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.