Server CPU usage is too high to troubleshoot and solve ideas

Source: Internet
Author: User

Discovery Server CPU usage is particularly high

Troubleshooting ideas:

-Use top or Mpstat to view CPU usage
# Mpstat-p All 2 1
Linux 2.6.32-358.el6.x86_64 (linux-host) 01/05/2016 _x86_64_ (CPU)

04:41:13 PM CPU%usr%nice%sys%iowait%irq%soft%steal%guest%idle
04:41:15 PM all 0.56 0.00 0.25 0.00 0.00 0.04 0.00 0.00 99.14
04:41:15 PM 0 3.08 0.00 1.03 0.00 0.00 0.51 0.00 0.00 95.38
04:41:15 PM 1 1.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 98.00
04:41:15 PM 2 0.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.00
04:41:15 PM 3 1.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 98.51
04:41:15 PM 4 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 5 0.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.00
04:41:15 PM 6 0.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.00
04:41:15 PM 7 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 8 0.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.00
04:41:15 PM 9 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 11 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 12 1.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 98.00
04:41:15 PM 13 1.50 0.00 0.50 0.00 0.00 0.00 0.00 0.00 98.00
04:41:15 PM 14 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 16 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 17 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 18 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 19 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 99.50
04:41:15 PM 20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 22 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:41:15 PM 23 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.50

-top identify high-occupancy process IDs

-View the number of threads that the process occupies, such as Java:
# Ps-elf|grep Java|wc-l
1065

Solve the problem of uneven CPU usage or excessive usage

Taskset

Taskset is a command provided by Linux (Ubuntu system may need to install itself, Schedutils package). He can have a program run on some (or) of the CPUs.

1) shows the CPU the process is running on

# taskset-p 3495
PID 3495 ' s current affinity mask:ffffffff


Note: The ffffffff of the result is actually a binary 32 low-level 1 bitmask, each 1 corresponds to 1 CPUs, indicating that the process runs on 32 CPUs

2) Specify that the process is running on a specific CPU

# TASKSET-PC 3 3495

Show Results:

PID 3495 ' s current affinity list:0-31
PID 3495 ' s new affinity List:3

Note: 3 means that the CPU will only run on the 4th CPU (counting from 0)

3) Specify CPU when process starts

# taskset-c 1./redis-server. /redis.conf

Server CPU usage is too high to troubleshoot and solve ideas

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.