Portal Home > Knowledgebase > Articles Database > cpu % >> server-status VS. top
cpu % >> server-status VS. top
Posted by Gigaron, 07-01-2010, 11:39 PM |
I'm wondering which is more accurate.
I ran a script to sum up the CPU of processes from top and the cpu load % seems vastly different to that displayed on server-status in apache.
If I want to know the actual cpu usage of apache, should I use server-status or top?
|
Posted by RJohnson23, 07-02-2010, 01:42 AM |
Does Apache show % CPU usage? I thought it just shows load averages.
|
Posted by Gigaron, 07-02-2010, 01:46 AM |
Something like: CPU Usage: u781.75 s274.36 cu0 cs0 - .288% CPU load
Is this CPU load supposed to be reflecting the actual CPU usage?
|
Posted by UNIXy, 07-02-2010, 02:14 AM |
Hi,
Here's how the CPU load is calculated:
(tu + ts + tcu + tcs) / tick / up_time * 100
tu - Time spent in user land
ts - Time spent in the kernel servicing system calls
tcu - Time spent doing context switches
tick - Time slice granularity (HZ)
up_time - Apache uptime
So the CPU load is the time Apache spends using the CPU while it's running relative to other tasks and processes in the system. Check out mod_status.c for the details.
Regards
Joe / UNIXY
|
Posted by BH-Rob, 07-02-2010, 02:34 AM |
I always find the 'top' command to offer the best real time information about CPU use and load levels.
as UNIXy said the apache status is just the cpu amount that apache is using.
|
Add to Favourites Print this Article
Also Read