Sysctl config for high performance, large activity

7,043

define large activity? large number of files open? large files being transferred? lots of slow clients? This is taken off a machine that runs nginx serving 900+mb/sec of 120k or smaller images on a Quad Core Xeon 2.4. The settings on a server that does streaming content are much different. Each machine config is different based on the requirements. Blindly implementing these could make your performance better or worse.

fs/file-max=60000
fs/dir-notify-enable=0

net/ipv4/tcp_keepalive_time=600
net/core/rmem_max=262143
net/core/rmem_default=262143
net/core/wmem_max=262143
net/core/wmem_default=262143
net/ipv4/tcp_sack=0
net/ipv4/tcp_timestamps=0

net/nf_conntrack_max=262143
net/ipv4/tcp_frto=0

net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_wmem = 4096 65536 4194304
net.ipv4.tcp_rmem = 4096 87380 4194304

net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
net.core.wmem_default = 16777216
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144

net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2

While the information on this page is somewhat old, much of it still applies:

http://www.acc.umu.se/~maswan/linux-netperf.txt www.ibm.com/developerworks/linux/library/l-hisock.html slaptijack.com/system-administration/linux-tcp-performance-tuning/

Share:
7,043

Related videos on Youtube

abc
Author by

abc

Updated on September 17, 2022

Comments

  • abc
    abc almost 2 years

    We have some server with a huge amount of visitors (every minute, every day). Basically we had a nice fine-tuned sysctl config for this purpose. (If you don't modify it, it starts to behave strangely).

    I'd like to ask the community if you could provide me one which.. well.. optimized for this purpose. Like maximizing open file limits and so on. That's what I meant.

  • abc
    abc almost 14 years
    Basically it's a machine which serves out a lot of dynamic webpage requests. The page uses ajax/php. | The other one serves out about 1k image every 30 min so to say. ... What would you say for these?
  • Matt Simmons
    Matt Simmons almost 14 years
    Does that machine have a NIC which features TCP offloading?
  • abc
    abc almost 14 years
    Thaaat is a really good question. I think it does. It's a very high performance dedicated server from a German provider. (If you tell me how could I check it, I'll report back ASAP!)
  • gal
    gal almost 14 years
    what problems are you experiencing with your current setup that the host isn't fixing?
  • abc
    abc almost 14 years
    Basically there was some strange errors by lighttpd and the running server-side application kept crashing. The links + config helped me. Thanks.