About context switches in Linux

Source: Internet
Author: User
Tags switches

For the context of Linux has been no special attention to its reasonable scope should be how much (about the concept of context switching, there are a lot of explanations on the Internet, again no longer repeat), the occasional notice during the day, the evening specifically looked at the next day load and after the load and after the following (server 1,8C/16GB, Run 1 mysql,8 Java processes, 1 rabbitmq):

The context switch for the corresponding time period is as follows:

Overall, the context is around 2000-2500 during server idle time.

server 2 (1 MySQL, this is our optimized market and wind control after the load, the original average around 45%):

Server 3 (1 mysql):

As for when the load is busy, the context switch should be what the value is, depending on the type of system (CPU-intensive or IO-intensive) and how many processes and threads are running.

If the system% is relatively high, setting the binding process through Taskset to a specific CPU may have some relief (taskset is not so much to let the process bind on a particular CPU, rather than set a higher priority).

What should be the reasonable CPU of system% and user%?

As a reference or experience summary:

1. For each CPU to run the queue do not exceed 3, for example, if the dual-core CPU should not exceed 6;

2. If the CPU is running at full load, the following distribution should be met

A) User time:65%~70%

b) System time:30%~35%

c) idle:0%~5%

PS: For the concept of context switching, refer to: http://blog.sina.com.cn/s/blog_4adc4b090102vufu.html

About context switches in Linux

Related Article

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.