FreeBSD Server Administration

« 10MB or 100MB Uplink? | Main | Portaudit Follow-up »

June 18, 2005

Performance Tuning

I have been considering to upgrade my 10 MB uplink, but after read the system tuning in the handbook, I realized something else was more important than the bandwidth limit, especially kern.ipc.somaxconn:

The default value 128 is typically too low for robust handling of new connections in a heavily loaded web server environment. For such environments, it is recommended to increase this value to 1024 or higher.

I raised kern.ipc.somaxconn to 1024 with the sysctl command:
# sysctl kern.ipc.somaxconn=1024

To avoid running this command every time the server reboots, I also added the following line to /etc/sysctl.conf:
kern.ipc.somaxconn=1024

Apache could be a bottleneck too. I also modified Apache configuration and did a graceful restart:
MaxKeepAliveRequests 200 (from 100)
MaxClients 300 (from 150)


Category : Apache

Posted by FreeBSD Newbie at June 18, 2005 01:56 AM

Comments

Did upping somaxconn work?

More important than the MaxKeepAliveRequests and MaxClients in Apache is probably the KeepAliveTimeout.. If that's too high, the all your server processes will be kept waiting on inactive connections.

I'm tweaking for pretty busy server - I've set KeepAliveTimeout to 3 seconds, and just upped somaxconn myself just now.

Posted by Darrin Ward at April 12, 2008 07:03 AM

Post a comment



(Optional, will not be shown to the public)

Remember Me?