Site locking but CPU and Mem OK

DomboCom

New member
Jun 4, 2009
381
8
0
Three times now in the past couple days my site has locked up when I send a lot of traffic to my site. A lot meaning about 200 visitors a minute. The weird thing is that there doesn't seem to be any overloading at all and everything looks stable. RAM and CPU usage appear to be fine.

I'm adding more RAM anyway to see if that helps, but is there something else I could be missing? My host keeps saying that everything looks good and I don't need an upgrade, but one guy suggested upgrading to SAS drive. I'm using Prosper202 and some other php scripts that do some heavy SQL queries for each visitor.

Here's my current setup...

Processor: Intel Q6600 QUAD CORE
Memory: 2GB DDR SDRAM
Hd1: 250GB 7200RPM SATA / 8MB Cache
Hd2: 120GB 7200RPM SATA / 8MB Cache
OS: Linux - CentOS 5 (+32 Bit)


Thanks
 


Here are a few ways to find out the issue -

1. See Apache MaxClients limit in httpd.conf , is it set at 150 or 256 ? Or none ?
If you are running cPanel , go to Apache Status in WHM , you will see Number of requests currently being processed. If it is close to the MaxClients limit, you need to increase it.

Increasing MaxClients limit will cause increase in memory usage, so make sure you have lots of RAM available.

Also, set other parameters accordingly, when you set MaxClients.

2. In command line, type iostat and press enter. See IOwait column, this should generally be below 10%. If it is higher, it means your HDD is slow and IO is taking a hit. You may need DB optimization, or a faster drive (or RAID)
 
Thanks for all the tips.

As far as apache error_log goes, these are the only things:
Code:
[Sun Nov 14 19:37:10 2010] [error] [client 170.218.231.21] File does not exist: /home/user/public_html/403.shtml
[Sun Nov 14 19:39:45 2010] [error] [client 75.74.99.84] File does not exist: /home/user/public_html/crossdomain.xml
[Sun Nov 14 21:09:18 2010] [error] [client 76.178.22.198] File does not exist: /home/user/public_html/403.shtml, referer: http://127.0.0.1:4664/preview?event_id=155014&schema_id=2&q=go&s=000000000000000000000000000
There are a ton of the 403 errors, and a handful of the next two errors, but I have no idea what crossdomain.xml or that 3rd error is all about. That "referer: http://127.0.0.1:4664" Is very strange. Otherwise I'm error free.

Are these 403 errors normal or is that a problem? I have .htaccess set up so it redirects 403 pages to my default landing page like this, but I'm not sure why I'm receiving some many 403's to begin with (unless people are just trying to poke around my site).
Code:
RewriteEngine on
redirect 301 /index.html http://mysite.com/landingpage.html
ErrorDocument 404 http://mysite.com/landingpage.html
Memcache is installed and running and yesterday maxclients was moved up from 100 to 250. That helped a lot, but still some issues.

The page was a single php page and made some changes so it would work in html, replacing the php code with some javascript. I'm thinking that will help as well (not realizing html was client side and the toll a php page can take on a server). I'm sure that contributed, but Prosper202 and another heavy database program is in use that I'm sure is the culprit.

I'm upgrading my RAM to 8gb since the cost isn't much at all. We'll see if that helps. Thanks for the tips on iostat. I'm checking sql logs now to see if anything is going on there.

Not sure if I can give rep to everyone, but will give out as much as I can for the help. Much appreciated!

Also, not sure if it would help, but was thinking about moving the images to Amazon S3. Just a thought that might help speed things along. Any thoughts on that or any of the above?
 
+rep thanks LeapSwiitch! I'll make these tweaks and post back if I have any more problems.
 
Everything looks pretty good after the RAM upgrade, but was hitting MaxClients when set to 250. So I raised that to 350.

Do I just change 'ServerLimit' and 'MaxClients' in my Apache settings, or are there other things that need to be tweaked as well when increasing MaxClients? MaxRequestsPerChild is 1,000.

Also, I rant the iostat command a few times while getting heavy traffic and it seemed to stick around 0.12. So I'm guessing that's good?
 
Everything looks pretty good after the RAM upgrade, but was hitting MaxClients when set to 250. So I raised that to 350.

Do I just change 'ServerLimit' and 'MaxClients' in my Apache settings, or are there other things that need to be tweaked as well when increasing MaxClients? MaxRequestsPerChild is 1,000.

Also, I rant the iostat command a few times while getting heavy traffic and it seemed to stick around 0.12. So I'm guessing that's good?

Your iostat value is optimal.

You should increase StartServers , MinSpare and MaxSpare according to your MaxClients.

Your MaxRequestsPerChild value is fine.