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

closed as too broad by HopelessN00b Dec 5 '14 at 10:49

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the 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

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.


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


[ 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.


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.

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