|Wretched Apache performance|
Apache performance like this should be a crime
| 8:10 pm on Apr 7, 2003 (gmt 0)|
I have a machine that serves a whole heck of a lot of images (no, not porn!), something on the order of 2 million a day (hereafter, "Metric Pantload"). The machine that was handling this until last week was doing fine, if a little stressed; I've since been forced to move to another machine, and even a faster one, but my performance in going into the toilet!
The previous machine was a Duron 1.3gHz with 512M and 7200 RPM IDE, and the new one is a Pentium 4 2.0gHz with 1 GB o' RAM and a 7200 RPM drive, both running Apache 1.3.x. On the old machine I had my MaxClients set at 250 (w/o keepalive) and it seemed okay with acceptable performance -- on this new I've gone so far as to raise the the MaxClients to 400 in desperation (with 'ps' showing a count of 402 all the time) and it's still not keeping up (again, w/o keepalive), with requests timing out left and right. I don't think it's the connection itself as it's a 10mbps line and I have mod_throttle set at 500kb/sec and not yet getting any warnings; I don't think I'm saturating the line. I've copied the config file I used on the old machine to the new one so the configs are more or less the same. Other than the Apache config changes I've made the machine is otherwise a virgin RedHat 7.2 install (with Ensim, disabled).
The only two explainations I can figure out is a) it's trying to do reverse DNS lookups, or b) the disk is just too slow. I but I really think it should be able to handle this.
I have considered moving to an "alternative" web server that are said to handle high loads better such as Boa or Tux, but if I can salvage Apache it would be preferable.
It's times like this I think I'd like to move to Montana and keep some sheep and deal with no unit of time shorter than a season.
| 4:56 am on Apr 9, 2003 (gmt 0)|
Apache Perfomance notes, very helpful.
| 4:45 pm on Apr 9, 2003 (gmt 0)|
Update: After days of telling me it was something I did, I glanced at the output of ifconfig; the provider (Rackshack) quickly changed their stance of "you must have changed something" to "Hey, 3 million collisions a day isn't normal". There was a misconfiguration on their switch port that was making every other packet collide and, consequently, little data could get through. However it took some prodding before they admitted it was something on their end.
What have we learned? : High collision rates are not normal for a switched ethernet port and they will hurt performance if too high. All Apache problems are not caused by Apache directly. You can monitor your network performance in a very cursory manner using ifconfig under *nix or similar tools (ipconfig?) under Windows.
A lot of this stuff appears in no faq or manual, unfortunatly; it's one of those things you stumble on by accident and then kick yourself for not having checked it before.