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 figure it's a good idea to have a central question for linux network tuning. I'm particularly interested in tuning options for the following.

  1. Web server
  2. Varnish / Squid server
  3. DB server
  4. File server
  5. App server
share|improve this question
1  
So much of this is very subjective based on what you're actually doing/serving. –  f4nt May 22 '09 at 6:33
    
... and different applications require different OS tuning. For example a fileserver on a lan should be configured with big buffers to server a moderate number of users quickly. Whereas a public website must be frugal with the amount of buffering offered to each connection to avoid resource starvation –  Dave Cheney May 22 '09 at 7:34
    
That's why I'm looking for different suggestions for different servers, not a one size fits all. –  JB. May 22 '09 at 19:22
    
Then ask separate questions. –  womble Jan 6 '10 at 0:20
add comment

3 Answers

At this point it's generally not worth the overhead of "tuning" within the kernel. Unless you have the test gear (or a cluster to A/B options on) and very good documentation it's not worth it for the sys-admin overhead alone.

These days the linux kernel has good auto-tuning of TCP, you can do better, however those are not the default because they're seen to be "greedy" and not fair on the Internet.

As close as I get to tuning is:

  1. Mount noatime (implies nodiratime), using ext3 or xfs
  2. Run only needed services
  3. For services like squid & mysql allow them to use more RAM

With rare exceptions those three will get you 90% there.

share|improve this answer
add comment

network stack tuning i put on routers/firewalls connecting to net hundreds of users

net/ipv4/route/max_size=262144
net/ipv4/netfilter/ip_conntrack_tcp_timeout_established=18000
net/ipv4/neigh/default/gc_thresh1=1024
net/ipv4/neigh/default/gc_thresh2=2048
net/ipv4/neigh/default/gc_thresh3=4096
net/netfilter/nf_conntrack_max=128000
net/netfilter/nf_conntrack_expect_max=4096

[ mostly empirically tweaked over years based on some unpleasant crashes ]

for file/sql/poroxy server you definitivly want to mount partition with data/spool with noatime,nodiratime and for reiserfs - notail ] to avoid additional disk trashing whenever file is accessed for read.

and you really want [ maybe you don't know about it yet ;-] gather statistics - eg with munin - to do some capacity planning and see if your tuning indeed decreases system load.

share|improve this answer
add comment

One thing you may want to look at web100. It is a kernel patch, and a userland too designed to optimized the Linux kernel for high-performance networks.

The Web100 project is aimed at producing a complete host-software environment that will run common Web applications at 100% of the available bandwidth, regardless of the magnitude of a network's capability.

Also check out High Performance SSH/SCP.

SCP and the underlying SSH2 protocol implementation in OpenSSH is network performance limited by statically defined internal flow control buffers. These buffers often end up acting as a bottleneck for network throughput of SCP, especially on long and high bandwith network links. Modifying the ssh code to allow the buffers to be defined at run time eliminates this bottleneck.

share|improve this answer
add comment

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.