We have a server with more or les 30K daily pageviews with 6k unique users. Its content is mainly all dynamic but lately we've been experimenting some problems at peak hours. That's some of our info: Celeron® 2.0GHz Processor 1 GB RAM Timeout 120 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 2 <IfModule prefork.c> StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule> <IfModule worker.c> ServerLimit 256 StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> I think that we shouldn't have the problems we have, it's not that much visits! Please advise... we've tried tons of configurations and we don't know what it could be... Or maybe it's not apache... Thanks!
Thanks for your replies... I have changed the settings for what LH-Danny said and still freezes when the server has more or less 150 users at the same time. Now I'm having this CPU Usage: u6.72 s1.74 cu0 cs0 - 6.18% CPU load 25.3 requests/sec - 118.8 kB/second - 4814 B/request 256 requests currently being processed, 0 idle workers WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Any ideas? Thanks again, I really appreciate it.
Next time during peak hours, run the top command and paste it here. That way I can see what is freezing your CPU. Apache should be running ok tbh.
post more info: aka running mysql on same machine? any specially compiled modules/kernels/patches ? any log entrys? memory leaks?
Hi all! Thanks for your help! George: aka running mysql on same machine? YES any specially compiled modules/kernels/patches ? NO any log entrys? memory leaks? LOGS ARE FINE. MYSQL SLOW LOG is also fine, we fixed this a while ago. Here I attach a screenshot of top, but after running the command ab to stress the server. Looks like mysql is consuming CPU dramatically. Maybe it's a problem of MySQL? Any advise on this? Now we have a dedicated server with both apache and mysql running. Is that normal? Any help would be really appreciated.
Use mytop to look at what queries are taking a long time to complete. Basically, you will need to optimize your mysql config (my.cnf) but more importantly, you need to optimize your scripts to be more efficient in querying (use caching, indexes are properly utilized, etc). If you have a dedicated machine for running MySQL, it will be faster. A faster CPU than the Celeron will also give you better MySQL performance.
The Universes thanks for the mytop hint! I didn't know that program!!! But all the queries are pretty fast, they take less than a second to complete... The screenshot I attached was after running the command ab to stress the server, that's maybe why mysqld is so cpu consuming. Is it normal?
This it top when it doesn't load any page (now I'm not using apache bench) And this is when it has a lot of users, but it still works, I guess before crashing
The last two top printouts show a lot of iowait, which is causing your load averages to shoot up. It looks like your swapping a lot, which will cause that.
Reduce RAM usage (use top to find out what program is hogging it) or add more RAM. From the looks of it, you have a lot of Apache child procs when it happens, meaning theres quite a few concurrent users at that time. You might want to look into optimizing the httpd.conf some more, taking out modules that you don't use to reduce memory usage. Otherwise, something like Lighttpd is much more suitable for high number of concurrent connections and low memory footprint.
i think you can use IISA in the place of APCHI web server. this webserver is more effective then APCHI. and it should resolve your problem.regards.