Sudden increase in CPU Usage

I am fairly new to linux administration so please help me out.

I have an email server set up at one of my linodes 768 running Ubuntu 12.04 LTS. Since yesterdsay I am receiving automated emails that CPU usage is significantly high. Around 130.9% !

It has been a very fair ride running the server for last 3-4 months. What could be the possible problem and how to trouble shoot it ? Couldve restarted the linode but I want to fix it first.

![](" />

4 Replies

Use the top command to see what process is consuming more CPU than it should.

(Alternatively, apt-get install htop and run htop because it's easier to read)

This is what #top command gave me. Here it says 27.8% usage with 130 tasks. As i said I am not the expert but there seems to be a conflict in what terminal command show, to what linode shows in its graphs at dashboard. Really confused.

top - 07:54:08 up 32 days, 10:42,  1 user,  load average: 1.13, 1.06, 1.10
Tasks: 130 total,   2 running, 128 sleeping,   0 stopped,   0 zombie
Cpu(s): 27.8%us,  2.9%sy,  0.0%ni, 68.9%id,  0.0%wa,  0.0%hi,  0.2%si,  0.2%st
Mem:    767680k total,   726984k used,    40696k free,    14452k buffers
Swap:   262140k total,    74312k used,   187828k free,   250468k cached

Following is the data shown by top. Does it show anything ambiguous ?

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND 
9945 www-data  19  -1 58024  13m 5748 S   23  1.9   2:37.93 /usr/sbin/apache2 -k start
 9943 www-data  21   1 58028  14m 5940 S   23  1.9   2:37.05 /usr/sbin/apache2 -k start
 9964 www-data  20   0 58024  14m 5952 S   23  1.9   2:27.50 /usr/sbin/apache2 -k start
 9946 www-data  20   0 58280  14m 5748 S   22  1.9   2:38.22 /usr/sbin/apache2 -k start
10242 www-data  20   0 58272  13m 5464 S   22  1.8   1:14.96 /usr/sbin/apache2 -k start
 9709 www-data  20   0 59060  14m 5944 R   21  2.0   6:45.90 /usr/sbin/apache2 -k start
 7067 mysql     20   0  321m  42m 3708 S    3  5.7  15:56.11 /usr/sbin/mysqld
    1 root      20   0  3532 1388  888 S    0  0.2   0:00.69 /sbin/init
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 [kthreadd]
    3 root      20   0     0    0    0 S    0  0.0   0:02.40 [ksoftirqd/0]
    4 root      20   0     0    0    0 S    0  0.0   0:00.00 [kworker/0:0]

It shows that Apache is seeing substantial sustained CPU usage, which might indicate very high load, or perhaps runaway PHP scripts if you're using mod_php. The growth pattern is very odd, though…

Do you see anything unusual in your Apache logs?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct