Centos CPU optimization

Source: Internet
Author: User
Tags valgrind
1 View L1, L2. .. dmesgx86info-c (yuminstallx86info-y) 2 hit rate, loss rate view: valgrind -- tool = caohegrind Command 3 View process priority (usually 0 by default) chrt

1. check L1, L2...

Dmesg x86info-c (yum install x86info-y) 2 hit rate, loss rate view: valgrind -- tool = caohegrind Command 3 View process priority (usually 0 by default) top three priorities of chrt-p 29022 (process number): SCHED_RR 1 ~ 99 adjustment method: chrt-r 50 command SCHED_FIFO 1 ~ 99 adjustment method: chrt-f 50 command SCHED_OTHER 100 ~ 139 (the adjusted value is-20 ~ 19) adjustment method: nice-n-18 command renice-18-p 312 (process number) 4 average load rate view sar-q 1 2 (displayed every second, display twice) top uptime5 usage view mpstat sar-p all 1 2 iostat-c 1 2 more/proc/stat6 clock frequency (unavailable on xen) tick_divider = (in/etc/grub. add the kernel line in conf) 2 (= 500Hz) 4 (= 250Hz) 5 (= 200Hz) 8 (= 125Hz) 10 (= 100Hz) the smaller the tick_divider value, the higher the cpu consumption, the lower the performance, the higher the tick_divider value, the lower the cpu consumption, the higher the performance, and the lower the timer accuracy. 7. cpu frequency voltage/etc/init. d/cpuspeed this process can automatically adjust the cpu frequency and voltage value/etc/sysco Nfig/cpuspeed (the value of cpu frequency and voltage can be manually configured) 8 IRQ balancing this mechanism can allocate processes to different CPUs in a certain way (each 10 seconds by default) if you want to allocate the cpu task process by yourself: chkconfig irqbalance off (disable IRQ balancing) ls/proc/irq (view the current IRQ interrupt) 1 2 10 .... Ls/proc/irq/1/i8042 smp_affinity cat smp_affinity 00000001 (this is the cpu number) echo 00000002>/proc/irq/1/smp_affinity9 assign the process to the cpu taskset-p 0x00001 1 (assign the process with process number 1 to 0x00001cpu) 10 determine which CPUs are running after startup vim/etc/grub. conf isolcpus = 0, 1, 2... 11 view cpu and IRQ cat/proc/cpuinfo cat/proc/interrupt12 close cpu (cannot close cpu at startup) echo 0>/sys/devices/system/cpu/cpu1/online (disable cpu1) echo 1>/sys/devices/system/cpu/cpu1/replaceable/online (enable cpu1) 13. check the resources obtained by the process. cat/proc/3213/status14: group the cpu (default group:/) instance (create/cpusets cpu group) mkdir/cpusets grep cpu/proc/filesystems vim/etc/fstab mount-t cpuset nodev/cpusets/mount-a ls/cpusets /..... cpus ..... mem .... tasks... echo 1>/cpusets/cpus (allocate cpu to/cpusets) echo 0>/cpusets/mems (allocate mem to/cpusets) echo 3132>/cpusets/tasks (process number 3132 is bound to the cpusets group) cat/proc/3132/cpuset/cpusets (default /) (/cpusets/cpu_exclusive cpu in this group can only run in this cpu group) (/cpusets/yy_on_release automatically clears the cpu group cache switch)


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.