Welcome to WebmasterWorld Guest from 220.127.116.11
At peak times we get google crawl and server gets load more than 500 ;-)
in the meantime i'm trying to block google bots but i've discovered one big thing,
when load grows i can see that all 8 CPU is not working on 100%
everytime i check htop or vmstat 1, i see cpu usage on 50 % or less, server gets load 600 or so and cpu only 50%, why ? i feel like our server is not well configured,
I have got: Dual Quad Core :
Intel(R) Xeon(R) CPU E5320 @ 1.86GHz
I've got an idea to upgrade to 3GHZ quadcore CPU, but my admin from hosting told me that better CPU don't need to fix this problem, it looks like apache is not well configured for best performance on this server.
we upgraded to latest apache version + latest php version.
btw: I get about 1,3 million pageviews a day on this box.
If you are using the prefork one (that's the default if I'm not mistaken), then you can play around with the MaxRequestsPerChild, by increasing it to the double of it (to start with), increase StartServers to something around 200, increase MinSpareServers to 20-30, and MaxSpareServers to 50. These will make the processes die less often (therefore less processes need to be created), and also will keep more processes at hand, so the Apache will generally spend less time on process creation (for the price of a bit higher memory usage).
But this is only about the OS processes, besides of these directives there are many other ones in your Apache configuration and (hopefully not) in your .htaccess files which can severely affect performance, you should read the Apache Performance Tuning [httpd.apache.org] in the Apache documentation, it could be a very good starting point for you.
Server Version: Apache/2.2.6 (Fedora)
Server Built: Sep 18 2007 11:26:13
Current Time: Tuesday, 26-Feb-2008 20:06:06 CET
Restart Time: Tuesday, 26-Feb-2008 19:55:04 CET
Parent Server Generation: 0
Server uptime: 11 minutes 2 seconds
Total accesses: 96445 - Total Traffic: 207.3 MB
CPU Usage: u198.88 s58.85 cu.58 cs0 - 39% CPU load
146 requests/sec - 320.6 kB/second - 2253 B/request
1500 requests currently being processed, 0 idle workers
maybe i can't get more from that dual quad, i think now about that CPU's with 3GHZ, do you think is there any solution yet ?
forgot to mention, that i use this server only for scripts, mysql and pics are on different machine
You won't necessarily reach the 100% processor usage, when your script is waiting for disk operations, when it is reading data from the database, those are idle times for the processor. I strongly suggest you to review your httpd.conf for directives which could make the requests served slower (AllowOwerride is a good example of that). In general it is not only the processor which could make a server slower, but the disk and the memory, if you do not have enough memory (a php script for example could easily consume 2 megabytes of ram, without any file or stream operation included, but depending on the modules used, and the actual content of your scripts), so with 1.000 concurrent requests it could go up until 2 gigabytes, without allocating memory for Apache or for the other Apache modules. The disks could also affect the speed, if you have logging enabled, then Apache need to read the scripts, and also write the logs. Newer Apaches has buffered logs, but I did not found them help too much in decreasing the load on the disks.
So what I can suggest is to review your whole Apache configuration, take away modules which are not used, remove (replace) slow directives, and consider switching to the worker MPM. Adding faster CPU's might help indeed, but that only depends on why the system is slow (I guess that's your problem). If the database server giving responses in matter of seconds only, then you better upgrading the database server, not the webserver.
By the way, enabling compression only helps if you have the content already compressed, if Apache (or PHP, or any other language) need to compress it on the fly, that will cost a lot of resources considering the load on you server.