Skip to content

Instantly share code, notes, and snippets.

@epotex
Forked from perusio/gist:2154235
Created February 16, 2018 06:47
Show Gist options
  • Save epotex/68e85051ccf9b0ed1bb30aa7c45d0f04 to your computer and use it in GitHub Desktop.
Save epotex/68e85051ccf9b0ed1bb30aa7c45d0f04 to your computer and use it in GitHub Desktop.

Revisions

  1. @perusio perusio created this gist Mar 21, 2012.
    48 changes: 48 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    ## From a post on the ML, apropos this:
    ## http://lowlatencyweb.wordpress.com/2012/03/20/500000-requestssec-modern-http-servers-are-fast.
    ## For sysctl.conf

    net.ipv4.tcp_slow_start_after_idle = 0


    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

    ## Nginx config.
    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;
    }
    }
    }