How Linux restricts the use of resources

Source: Internet
Author: User

Many people say Virmach is not good, always suspend, I have never been suspend, build station is also very stable, so I would like to say how to operate (in fact, follow their TOS, if you are abusive user, rolling coarse):

To read the TOS first, the core rules are:
(1) The CPU can not be more than 5 minutes of burst more than 95%, two hours not higher than 50%,
(2) Limit Io, not more than 300 consecutive 10 minutes,
(3) Limit mail, no more than 100 per hour,

So do a few things in a targeted way:
One, under the/root/to establish the cpulimit.sh to execute the authority (the release occupancy rate below 10% the procedure, limits 60% above the procedure)
CPULimit--pid ' ps Aux|awk ' {if ($ <) print $ "--limit=99
CPULimit--pid ' ps Aux|awk ' {if ($ >) print $ "--limit=25
Second, install Cpulimt,apt-get installed cpulimit-y
Three, the execution cpulimt.sh write to Crontab, every five minutes to execute once, if there is any program CPU use more than 60%, it is limited to 25%, while releasing the low-occupancy program limit.

If you build a station, that's enough.

If you want to limit Io, then go to Cgroup/blkio. As for the mail, that's my thing ...

From Forum http://www.hostloc.com/thread-327153-1-1.html

How Linux restricts the use of resources

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.