[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1285
  • Last Modified:

Troubleshoot High System CPU Usage on Linux

I know how to troubleshoot application related problems on Linux but when the system process is the one choking my box, how to I isolate what is happnening?

I am not looking for help with this specific problem, but more a "how to" on isolating problems like this.

I have a server that is running with high System CPU of 96-99%

How do I go deeper in to what is happening

0
brittonv
Asked:
brittonv
2 Solutions
 
arnoldCommented:
run iostats to make sure that the choking is not because of I/O.
vmstat deakls with the system swapping.

you can use top to see which process is tying up the CPU
top -n 1
and see which process is at the top and how many percent of the CPU it is using.
Also look at the CPU load breakdown, system, user, io wait, idle,etc.

What applications do you have on the system?  You may have an application that is waiting for a resource that is deadlocked.
0
 
joolsCommented:
atop is also useful IMHO, it allows logging of data so you can run thru at a later date.

System CPU is (I believe) kernel related processing, you need to collect stats using a number of tools over a period of time, you could find that a high system is related to network or disk IO.
0
 
brittonvAuthor Commented:
I can not install iostat... long story.  Is there a way to get the same information otherwise? cat /proc/interrupts etc...

Forgive me but top only shows what users processes are running right?  I mean if I run top I see some things running at low cpu usage, with sys running at 99%.

0
 
arnoldCommented:
You would first have to determine what the issue is. If a tool that is necessary for such an evaluation is not available, your task is made much more complicated.  the system waiting for data from memory/disk or is impacted because the system is swapping i.e. the process needs XMB of memory and only a small amount is available. The system is then has to write to disk the current state of inactive processes to make space available for this process to run.

It is somewhat similar to a restaurant. i.e. you've an reservation of 10 people. The restaurant has to arrange the tables, and chairs, if you look at the employees prior to your reservation time, all sees ok, but right before you are seated, you see a bunch of activity around where your table will be i.e. several workers will be running around cleaning up the recently freed up tables, and then others will be arranging those tables to fit your group and then others still will be bringing the plates utencils. etc.

How long will your wait for seating be if there was only one person available to do all those steps?
 
0
 
madunixChief Information Security Officer Commented:
Root cause of high cpu usage could be looping process, application performing cpu intensive operation(s), paging due to process size exceeding resident memory (RAM), excessive logging..etc.
On linux system run the commands "vmstat, top, iostat, free, sar"  to give you a top like display of memory totals, paging amount, swap numbers, interrupts per second and much more. they are useful to determine where the performance bottleneck is on a machine.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now