Tracking high CPU load in VMWare Server

n000b

Well-Known Member
Apr 7, 2005
142
0
166
I've got a VMWare Server guest running CentOS 5 64bit with cPanel that only has about 6 websites on it, with the load sitting anywhere between 5 and 30 constantly. It has two virtual CPU's with 2GB of memory, hosted on a fast physical server that is not overloaded. Memory usage in the guest sits on about 1.8GB used, 1.1GB of which is cached. Here is a sample of the CPU usage in the guest which is approximately how it normally sits:

Cpu0 : 23.4%us, 13.5%sy, 0.0%ni, 60.9%id, 0.7%wa, 0.3%hi, 1.3%si, 0.0%st
Cpu1 : 23.6%us, 12.8%sy, 0.0%ni, 61.6%id, 1.3%wa, 0.3%hi, 0.3%si, 0.0%st

Here is a sample output from "top":

Code:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 5688 procomp   16   0     0    0    0 Z  9.0  0.0   0:00.27 php <defunct>
 3075 nobody    16   0  216m 144m 1836 S  8.0  7.4   0:13.24 httpd
 4344 nobody    15   0  216m 144m 1832 S  6.0  7.4   0:05.29 httpd
 5687 procomp   17   0  103m  14m 5468 R  5.7  0.7   0:00.17 php
 5694 procomp   18   0 99.2m  11m 4988 R  4.7  0.6   0:00.14 php
 4337 nobody    16   0  217m 144m 1832 S  4.3  7.4   0:07.30 httpd
 3925 nobody    16   0  217m 144m 1840 S  4.0  7.4   0:09.06 httpd
 4944 nobody    16   0  216m 144m 1816 S  4.0  7.4   0:05.28 httpd
 5561 nobody    15   0  216m 144m 1832 S  4.0  7.4   0:00.45 httpd
 5689 procomp   18   0 99484 9196 4832 R  4.0  0.5   0:00.12 php
 3944 nobody    16   0  217m 144m 1832 S  3.3  7.4   0:10.76 httpd
 5552 nobody    15   0  216m 144m 1808 S  3.0  7.4   0:01.10 httpd
 5693 procomp   18   0 97620 7016 4524 R  3.0  0.3   0:00.09 php
 5695 procomp   17   0 99.2m  11m 5000 R  3.0  0.6   0:00.09 php
 5474 nobody    15   0  216m 144m 1812 S  2.7  7.4   0:01.98 httpd
 5079 nobody    16   0  216m 144m 1804 S  2.3  7.4   0:02.63 httpd
 5551 nobody    15   0  217m 144m 1808 R  2.3  7.4   0:00.59 httpd
 2439 mysql     15   0  522m  86m 4060 S  1.7  4.4   0:12.70 mysqld
 2883 root      19   0  120m  20m 1512 R  1.7  1.0   0:01.79 lfd
 3457 named     24   0  166m  10m 2016 S  0.3  0.5   0:03.11 named
 5690 root      18   0  120m  19m  428 S  0.3  1.0   0:00.01 lfd
As you can see, all of the PHP and httpd processes are using high amounts of CPU. MySQL also seems to sit high. Sitting here watching the CPU usage, some PHP processes are using up to 50% CPU :eek:

Can anyone give me some advice on how I can try to track down what is using the high amounts of CPU? I am running an almost identical software configuration on two Xen VPS' and they run fine, but this VPS seems very slow. I really don't think that it is one of the websites causing high load as they don't get many visitors. I feel that it has something to do with VMWare but I wouldn't have a clue on where to start trying to track down something like this.

Thanks :)
 
Last edited:

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
Yes, seems httpd processes occupying high CPU load. Since you are running PHP as Apache module, it will not show you an exact username occupying high httpd resource.

Check in WHM -> CPU/Memory/MySQL usage. It will show you website name with high httpd usage.

May be you also need to check in the Apache error logs to find out if anything wrong there. The location is /usr/local/apache/logs/error_logs