[Linux] server performance tuning (CPU binding)

Source: Internet
Author: User

We all know that single process and asynchronous Io should be able to achieve optimal communication performance. But in reality, we often find that this model often fails to achieve the expected results.

This may be due to the network adapter and your applicationProgramCPU grab.

CAT/proc/interrupts check the number of interruptions to your Nic. Which CPU does it work on? Generally, your Nic should work on cpu0. (If not, bind it to cpu0)

CAT/proc/cpuinfo check how many CPUs you have and how many cores are there. Assume that it is a dual-CPU * quad-core.

Ps x | grep your_app to check the PID of your program. Assume that PID is 5678.

OK. Try the following magic:

Taskset-P 10 5678

If your program is single-thread asynchronous Io, you may find that your program's processing capability has increased by more than 30%. In addition, the performance data of the program will not float any more and will always be stable at the optimal value.

Why? Because we distribute the nic and application load to differentPhysicalCPU is on. If you do not switch between regions, there is no operation cost.

PS: redis, memcached, and nginx are popular on the Earth recently. They are all asynchronous Io. You can try this optimization method.

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.