We have a server with 8Cores, 16GB of RAM and RAID 0 SAS 10K drives. Our goal is to use this to serve a fairly simple php application quickly. We have tested all other components and we think we have narrowed it down to apache is our bottleneck.

I am no apache guru I have done some research and tested a couple things but when i test with JMeter launching 100 concurrent connections against the server the first 10 - 20 come back quickly 30 - 100ms but the rest take between 1000ms to 3000ms. Anyone have any ideas on what to change in our apache config to make this faster right now its a vanilla install of apache.

this is not the answer to your question, but a general tip: Use an opcode cacher. Switch to nginx + php-fpm. Use fastcgi_cache, or possibly Varnish to cache, depending on how complex rules you need to determine what to cache, and what not to.
–
3moloJul 20 '11 at 6:52

1

As ErikA said, get rid of that RAID0 (and if you've got just one disk, for christ's sake get at least one more). They say that RAID 0 means if the disk dies, 0 is the % you'll be able to recover.
–
tombull89Jul 20 '11 at 10:15

couple of thoughts - a) use an http accelerator like varnish in front of apache b) unless you need apache's power use nginx or the like c) switch from linux to a BSD or something decent d) post your httpd.conf file in order to help figure out what needs to change e) make sure hat apache is the bottleneck, are your SQL queries slow? your application? You have no idea. f) post what kind of tests jmeter does? does it slam you with lots of small queries? make legit requests? etc.
–
Good PersonDec 14 '12 at 15:47

3 Answers
3

Are you absolutely sure Apache is the real bottleneck for you? You didn't tell anything about your "fairly simple PHP application", but for me it sounds like it's using some database and that starts to slow things down quite soon during your benchmark.

The traditional Apache values you should consider tuning are MaxClients, ServerLimit, MinSpareServers, MaxSpareServers and TimeOut. But most of the time tuning those values is most helpful for static content; PHP and other dynamic stuff is more unpredictable from Apache's point of view. If a PHP script takes five seconds to run and eats 100% CPU, then it takes five seconds to run and eats 100% CPU, no amount of Apache tuning can help that.

What Linux distribution you have in use?

With the powerhouse server like you have Apache should easily serve thousands and thousands of HTTP requests per second with static content; with PHP the number can be much less.

You can also check how many time does your php interpreter spend to generate your webpage (depending of what your php scripts do), a good idea to improve the average time to "execute" a php script without a lot of effort is to use apc (enter link description here), check if it has been installed by your package manager (if you use one).

What about your test, did you make them on static content or on your php pages? So could you give more information about your architecture?! There is a lot of way to improve php/apache applications but we need more information :-) about your case