HUGE PHP/MySQL Bottleneck?

We're in the process of building a new (well, "new") server, so I'm not overly concerned by this, but would like to know if this is at all normal.

I run a really small site (as in 1 GB over 90 days... max) based on PostNuke. It's got Apache 2 on RedHat8. The machine is 300 MHz and has 128 MB RAM; hardly a speed demon, but we're also not exactly being hammered with traffic here.

The server's a wee bit sluggish, however. I at first just assumed it was just a slow link, either my ISP doing its usual thing, or maybe some of the other boxes on the T1 it shares were filling it. But it persisted for days, and others complained that it was insanely slow.

I eventually logged into the console, and tried using lynx. It still took FOREVER to load. After various fun, we saw that both httpd and mysql would shoot up to the top in top at about 100% CPU usage for a second, and then quickly drop back down. (MySQL spent far less time on top.)

I just ran ab (the Apache benchmark tool), and the results are rather scary. Loading a 300 KB JPEG image took an average of 25 ms processing time, serving a little over 70 requests/second. When I tried our PHP/MySQL-using site, the average processing time shot up to about 3.5 seconds, and we got 0.59 requests/second.

Anyway, we were given a faster box (with SCSI, and support for SMP), so we're going to be moving over, and maybe the problem just won't present itself on the newer box. But what I'm wondering is... What should we be expecting? It's obvious that PHP using several MySQL queries will take longer than static content, but taking over 3 seconds to render a page does not seem normal. Is it just a function of being on a 300 MHz box? This seems highly abnormal.

And also... Can you recommend a good configuration for httpd.conf / my.cnf? We have 20 httpd processes running at all times, which strikes me as _really_ excessive, as we probably never get more than a couple simultaneous visitors. The problem is that I don't really know how one goes about determining what a good value would be. Is there some guide to this? (Edit: I'm just asking for the Min/Max server settings, not expecting people to write me an entire httpd.conf file!)

 

 

 

 

Top