What do you think? Does this make sense?

lweeks

New member
If a process on a website is using too much of the CPU, isn't there something going on in that process that is using the CPU? So if an Apache process uses too much CPU, there must something on that page that causes it, right? It shouldn't be server related.
Just curious on what ya'll think.
 
Or is it server related?

-It meant to be questioned, "or is it server related?"

I was just curious to see what other people would conclude if a web site was having performance issues. Whether it's because of an Apache process that was using too much CPU, or if it would be because of the server itself.
 
CPU usage can increase if the I/O to the disk is too slow. If the system has to wait for other tasks to complete before it can END the current task, then your CPU usage can be held high. Same goes for MySQL, Mail Programs and other services on a server.

Also, if there's not enough memory available, then the CPU has to do much more work dumping things to a swap file and then importing again etc.

CPU being high usage can be any number of factors, including the script that is runing.
 
Your question isn't very clear.
By itself Apache wouldn't affect one site differently than another all things being the same.
A poorly written script or a page that uses a very CPU intensive process can result in high CPU use (for example a forum that has a bunch of poorly coded "add-on" scripts installed-removing one "bad" script could make a huge difference)

However we don't know if you are speaking as a server owner having problems with a web site or as a web site owner having problems with your host/provider telling you that you are using too much CPU for their TOS.
If it is the latter it can surely be affected by what their CPU is capable of and the memory etc. as others have mentioned.

For example (to clarify some of the above answers)

If you are a web site owner and your host is saying you are using too much CPU:
If the terms of service are based on a % of CPU which you are allowed within "X" amount of time:
2 servers are both running Apache and server "A" has an older "plain" hard drive, an older Celeron processor and 1GB memory :sad:
Server "B" has a new fast quad-core Xeon CPU with 8GB of memory running SCSI mirrored disks or SAS disks :)
You would use a greater % on server "A" than server "B" just because of the difference in the server.
It would be because of the amount of resources available not because of Apache.

We could be more helpful if we knew more about the situation you are in.
 
As rule CPU is eating up by the scripts you are running on the server. You need to understand that. Anyways I assume your particular web hosting service provider will be able to explain things to you.

Cheers
 
lweeks - I have a hosting account that's in a shared hosting environment and according to my hosting service provider, they have no set number of sites per box. They built their own automated hosting provisioning system that measures the "health" of their webservers and provisions new accounts on the healthiest server. Therefore, if all the sites on a specific box were low traffic html only sites, they can get 1000s on the box. If the sites on the box are all high traffic dynamic asp.net sites, then they would get 100s on a box. Therefore, all the boxes vary in the number of sites depending on what is going on in the box. It’s the same thing with the SQL boxes. They don't host SQL databases on the same box as websites.
 
Back
Top