Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an i5 server 2.8 Ghz, 16GB Ram, no swap, it is connected to 100Mbps port + Debian 6 Stable

I'm running a small LAMP site, and the server is almost idle... it uses 1400MB of ram and cpus near 4%.

I did a small benchmark from another server at 100Mbps

#!/bin/bash
for i in {1..300}
 do
  wget -b -r -l 1 -x www.site.com
 done

and I got this:

141 files, 3.3M (per download)

I can achieve up to 97Mbps, that's ok (MTRG).

But the problem is on the first server... when I got something like this:

root@server:~# ss | grep ESTAB | wc -l
300  (or more)

The server seems unresponsive, but it is still almost idle... The i/o according to iotop is idle too.

Mysql is setup to allow 1000 connections, no problems so far.

Apache config

Timeout 300
KeepAlive On

MaxKeepAliveRequests 0

KeepAliveTimeout 15

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

And

root@server:~# cat /etc/sysctl.conf
net.core.somaxconn = 10240
....

I played with Apache and Sysctl, looking for something better but I did not found it.

Any help is appreciated

share|improve this question
    
Can you please clarify what the problem exactly is? –  jjmontes Mar 4 '12 at 2:06

2 Answers 2

up vote 1 down vote accepted

Turn off KeepAlive and then re-run it.. You are keeping apache connections open for 15 seconds per connection waiting for another connection from the wget's you run. I'm sure you will get better results with KeepAlive off

share|improve this answer
    
Since KeepAlive is actually useful for real-world scenarios, dropping it to 5 seconds or lower might be a better compromise. –  Ladadadada Mar 4 '12 at 18:08
    
thank you. I tested with AB and wget again and works extremely well. I set it to 1 second. –  Nick Mar 4 '12 at 20:27

You can also probably safely increase the MaxClients setting. Apache children often use between 20MB and 100MB depending on what modules you have loaded. Unless you are at the top end of that range you can probably handle 200 or 300 children.

More children means more simultaneous requests, even if the children are tied up with keepalives.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.