OS tuning an nginx webserver machine

Quintin Par quintinpar at gmail.com
Wed Mar 21 02:54:48 UTC 2012

 Hi all,

Recently I resorted to tuning my nginx webserver box for more performance.
I went ahead an changed

sudo ip route change default via dev eth0 initcwnd 10

sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0

This changed exposed a much better performance than anticipated. And since
most of my pages are httpd cached, the load times went down from 2.3 – 3
seconds to 1.5-2 seconds

While browsing I came across another

  echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range

  echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle

  echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse

  echo "10" > /proc/sys/net/ipv4/tcp_fin_timeout

  echo "65536" > /proc/sys/net/core/somaxconn

  echo "65536" > /proc/sys/net/ipv4/tcp_max_syn_backlog

  echo "262144" > /proc/sys/net/netfilter/nf_conntrack_max

worker_processes     16;

worker_rlimit_nofile 262144;

daemon off;

events {

  use epoll;

  worker_connections 16384;


error_log error.log;

pid /dev/null;

http {

  sendfile   on;

  tcp_nopush on;

  keepalive_requests 100;

  open_file_cache max=100;

  gzip            off;

  gzip_min_length 1024;

  access_log off;

  server {

    listen *:8080 backlog=16384;

    location / {

      root   html;

      index  index.html;




But the type of machines that the tester has used does not allow me to
believe the results.

Have someone else gone along the same path? Are these system variable
changes recommended by the nginx community?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120321/10c0f618/attachment-0001.html>

More information about the nginx mailing list