Skip to content

Instantly share code, notes, and snippets.

@Nihisil
Created January 19, 2016 10:46

Revisions

  1. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Benchmarking Nginx with Go

    There are a lot of ways to serve a Go HTTP application. The choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. **The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.**
    There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. **The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.**

    So, these are the different settings we are going to compare:

  2. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -434,4 +434,6 @@ Transfer/sec: 5.09MB

    The first set of benchmarks was made with `ab` and some nginx settings was not very well optimized (gzip was enabled and it was not using keep-alive connections with the Go backend). After changing to `wrk` and following the suggestions to optimize `nginx` the results gone very different.

    The `nginx` overhead is not so big after all, however you probably want to use the HTTP proxy connection instead of FastCGI. Some folks said that Go's FastCGI is not well optimized and this may be the cause of the huge differences in the results presented here.
    With GOMAXPROCS=1, the `nginx` overhead is not so big after all, but with GOMAXPROCS=8 the difference is huge. I may try another settings in the future but for now, If you need `nginx` features like virtual hosting, load balancing, caching, etc, use the HTTP proxy connection instead of FastCGI. Some folks said that Go's FastCGI is not well optimized and this may be the cause of the huge differences in the results presented here.


  3. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -255,9 +255,9 @@ Date: Sun, 15 Dec 2013 14:59:14 GMT

    $ curl -sI http://127.0.0.1:8080/ | wc -c
    141
    ```shell
    ```

    ```shell
    $ curl -sI http://go.http/
    HTTP/1.1 200 OK
    Server: nginx
    @@ -268,9 +268,9 @@ Connection: keep-alive

    $ curl -sI http://go.http/ | wc -c
    141
    ```shell
    ```

    ```shell
    $ curl -sI http://go.fcgi.tcp/
    HTTP/1.1 200 OK
    Content-Type: text/plain
    @@ -281,9 +281,9 @@ Server: gophr

    $ curl -sI http://go.fcgi.tcp/ | wc -c
    141
    ```shell
    ```

    ```shell
    $ curl -sI http://go.fcgi.unix/
    HTTP/1.1 200 OK
    Content-Type: text/plain
  4. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 4 additions and 9 deletions.
    13 changes: 4 additions & 9 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -198,7 +198,6 @@ func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Server", "gophr")
    w.Header().Set("Connection", "keep-alive")
    w.Header().Set("Content-Type", "text/plain")
    w.Header().Set("Vary", "Accept-Encoding")
    w.Header().Set("Content-Length", fmt.Sprint(len(body)))
    fmt.Fprint(w, body)
    }
    @@ -252,11 +251,10 @@ Connection: keep-alive
    Content-Length: 12
    Content-Type: text/plain
    Server: gophr
    Vary: Accept-Encoding
    Date: Sun, 15 Dec 2013 14:59:14 GMT

    $ curl -sI http://127.0.0.1:8080/ | wc -c
    164
    141
    ```shell
    ```
    @@ -267,10 +265,9 @@ Date: Sun, 15 Dec 2013 14:59:31 GMT
    Content-Type: text/plain
    Content-Length: 12
    Connection: keep-alive
    Vary: Accept-Encoding

    $ curl -sI http://go.http/ | wc -c
    164
    141
    ```shell
    ```
    @@ -281,10 +278,9 @@ Content-Length: 12
    Connection: keep-alive
    Date: Sun, 15 Dec 2013 14:59:40 GMT
    Server: gophr
    Vary: Accept-Encoding

    $ curl -sI http://go.fcgi.tcp/ | wc -c
    164
    141
    ```shell
    ```
    @@ -295,10 +291,9 @@ Content-Length: 12
    Connection: keep-alive
    Date: Sun, 15 Dec 2013 15:00:15 GMT
    Server: gophr
    Vary: Accept-Encoding

    $ curl -sI http://go.fcgi.unix/ | wc -c
    164
    141
    ```


  5. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Benchmarking Nginx with Go

    There are a lot of ways to serve a Go HTTP application. The choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. **The purpose of this benchmarks are not to tell that Go is faster or slower than nginx, that would be stupid.**
    There are a lot of ways to serve a Go HTTP application. The choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. **The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.**

    So, these are the different settings we are going to compare:

  6. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 267 additions and 74 deletions.
    341 changes: 267 additions & 74 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,30 +1,39 @@
    # Benchmarking Nginx with Go

    Today I just wanted to know which of these options is faster:
    There are a lot of ways to serve a Go HTTP application. The choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. **The purpose of this benchmarks are not to tell that Go is faster or slower than nginx, that would be stupid.**

    * Go HTTP standalone
    So, these are the different settings we are going to compare:

    * Go HTTP standalone (as the control group)
    * Nginx proxy to Go HTTP
    * Nginx fastcgi to Go TCP FastCGI
    * Nginx fastcgi to Go Unix Socket FastCGI


    ## Hardware

    The hardware is a very cheap one. Since we will compare all settings in the same hardware, this should not be a big deal.

    * Samsung Laptop NP550P5C-AD1BR
    * Intel Core i7 3630QM @2.4GHz (quad core, 8 threads)
    * CPU caches: (L1: 256KiB, L2: 1MiB, L3: 6MiB)
    * RAM 8GiB DDR3 1600MHz


    ## Software

    * Ubuntu 13.10 amd64 Saucy Salamander (updated)
    * Nginx 1.4.4 (1.4.4-1~saucy0 amd64)
    * Go 1.2 (linux/amd64)
    * ApacheBench 2.3 Revision 1430300
    * wrk 3.0.4


    ## Settings

    ### Kernel

    Just a little bit tuning in the kernel to allow higher limits. If you have some better idea with this variables, please drop a comment bellow:

    ```
    fs.file-max 9999999
    fs.nr_open 9999999
    @@ -47,11 +56,18 @@ vm.min_free_kbytes 65536
    vm.overcommit_memory 1
    ```

    ### Limits

    The `max open files` limit for `root` and `www-data` was configured to be 200,000.


    ### Nginx

    Some nginx tuning is needed. As some folks told me, I disabled `gzip` to be more fair in the comparisons. Here is its config file `/etc/nginx/nginx.conf`:

    ```nginx
    user www-data;
    worker_processes 16;
    worker_processes auto;
    worker_rlimit_nofile 200000;
    pid /var/run/nginx.pid;
    @@ -65,23 +81,27 @@ http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    keepalive_timeout 300;
    keepalive_requests 10000;
    types_hash_max_size 2048;
    open_file_cache max=200000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache max=200000 inactive=300s;
    open_file_cache_valid 300s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;
    server_tokens off;
    dav_methods off;
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    gzip on;
    gzip_disable "msie6";
    gzip_min_length 512;
    gzip_vary on;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    access_log /var/log/nginx/access.log combined;
    error_log /var/log/nginx/error.log warn;
    gzip off;
    gzip_vary off;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
    }
    @@ -90,17 +110,29 @@ http {
    ### Nginx vhosts

    ```nginx
    upstream go_http {
    server 127.0.0.1:8080;
    keepalive 300;
    }
    server {
    listen 80;
    server_name go.http;
    access_log off;
    error_log /dev/null crit;
    location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_pass http://go_http;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    }
    }
    upstream go_fcgi_tcp {
    server 127.0.0.1:9001;
    keepalive 300;
    }
    server {
    listen 80;
    server_name go.fcgi.tcp;
    @@ -109,10 +141,16 @@ server {
    location / {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9001;
    fastcgi_keep_conn on;
    fastcgi_pass go_fcgi_tcp;
    }
    }
    upstream go_fcgi_unix {
    server unix:/tmp/go.sock;
    keepalive 300;
    }
    server {
    listen 80;
    server_name go.fcgi.unix;
    @@ -121,7 +159,8 @@ server {
    location / {
    include fastcgi_params;
    fastcgi_pass unix:/tmp/go.sock;
    fastcgi_keep_conn on;
    fastcgi_pass go_fcgi_unix;
    }
    }
    ```
    @@ -137,16 +176,38 @@ import (
    "net"
    "net/http"
    "net/http/fcgi"
    "os"
    "os/signal"
    "syscall"
    )

    var (
    abort bool
    )

    const (
    SOCK = "/tmp/go.sock"
    )

    type Server struct {
    }

    func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintln(w, "Hello World")
    body := "Hello World\n"
    // Try to keep the same amount of headers
    w.Header().Set("Server", "gophr")
    w.Header().Set("Connection", "keep-alive")
    w.Header().Set("Content-Type", "text/plain")
    w.Header().Set("Vary", "Accept-Encoding")
    w.Header().Set("Content-Length", fmt.Sprint(len(body)))
    fmt.Fprint(w, body)
    }

    func main() {
    sigchan := make(chan os.Signal, 1)
    signal.Notify(sigchan, os.Interrupt)
    signal.Notify(sigchan, syscall.SIGTERM)

    server := Server{}

    go func() {
    @@ -164,86 +225,218 @@ func main() {
    fcgi.Serve(tcp, server)
    }()

    unix, err := net.Listen("unix", "/tmp/go.sock")
    if err != nil {
    go func() {
    unix, err := net.Listen("unix", SOCK)
    if err != nil {
    log.Fatal(err)
    }
    fcgi.Serve(unix, server)
    }()

    <-sigchan

    if err := os.Remove(SOCK); err != nil {
    log.Fatal(err)
    }
    fcgi.Serve(unix, server)
    }
    ```

    ### Starting the engines
    ### Check the HTTP headers

    To be fair all requests must have the same size.

    ```shell
    $ curl -sI http://127.0.0.1:8080/
    HTTP/1.1 200 OK
    Connection: keep-alive
    Content-Length: 12
    Content-Type: text/plain
    Server: gophr
    Vary: Accept-Encoding
    Date: Sun, 15 Dec 2013 14:59:14 GMT

    $ curl -sI http://127.0.0.1:8080/ | wc -c
    164
    ```shell
    ```
    $ curl -sI http://go.http/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Sun, 15 Dec 2013 14:59:31 GMT
    Content-Type: text/plain
    Content-Length: 12
    Connection: keep-alive
    Vary: Accept-Encoding

    $ curl -sI http://go.http/ | wc -c
    164
    ```shell
    ```
    $ curl -sI http://go.fcgi.tcp/
    HTTP/1.1 200 OK
    Content-Type: text/plain
    Content-Length: 12
    Connection: keep-alive
    Date: Sun, 15 Dec 2013 14:59:40 GMT
    Server: gophr
    Vary: Accept-Encoding

    $ curl -sI http://go.fcgi.tcp/ | wc -c
    164
    ```shell
    ```
    $ curl -sI http://go.fcgi.unix/
    HTTP/1.1 200 OK
    Content-Type: text/plain
    Content-Length: 12
    Connection: keep-alive
    Date: Sun, 15 Dec 2013 15:00:15 GMT
    Server: gophr
    Vary: Accept-Encoding

    $ curl -sI http://go.fcgi.unix/ | wc -c
    164
    ```


    ### Start your engines!

    * Configure kernel with sysctl
    * Configure nginx
    * Configure nginx vhosts
    * Load the server (```sudo su - www-data ./server```)
    * Load the server as www-data
    * Run the benchmarks


    ### The benchmarks


    #### GOMAXPROCS = 1

    ##### Go standalone

    ```shell
    # wrk -t100 -c5000 -d30s http://127.0.0.1:8080/
    Running 30s test @ http://127.0.0.1:8080/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 116.96ms 17.76ms 173.96ms 85.31%
    Req/Sec 429.16 49.20 589.00 69.44%
    1281567 requests in 29.98s, 215.11MB read
    Requests/sec: 42745.15
    Transfer/sec: 7.17MB
    ```

    ##### Nginx + Go through HTTP

    ```shell
    $ export GOMAXPROCS=1
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    $ sudo ab -k -c 4000 -n 100000 http://go.http/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    #### Compiled results

    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    *time taken (s)* | 2.15 | 5.729 | 10.794 | 9.137
    *reqs/second* | 46517.04 | 17,454.89 | 9,264.48 | 10944.05
    *transfer rate (kb/s)* | 7,117,106.64 | 2,932,422.33 | 1,528,639.76 | 1,805,768.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | **1** | **1** | 8 | 32
    *max conn time (ms)* | **72** | 85 | 74 | 88
    *min proc time (ms)* | **0** | 100 | 102 | 91
    *avg proc time (ms)* | **81** | 223 | 418 | 329
    *max proc time (ms)* | **55** | 333 | 674 | 426
    *min total time (ms)* | **0** | 100 | 102 | 91
    *avg total time (ms)* | **82** | 224 | 426 | 361
    *max total time (ms)* | **127** | 418 | 748 | 514
    # wrk -t100 -c5000 -d30s http://go.http/
    Running 30s test @ http://go.http/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 124.57ms 18.26ms 209.70ms 80.17%
    Req/Sec 406.29 56.94 0.87k 89.41%
    1198450 requests in 29.97s, 201.16MB read
    Requests/sec: 39991.57
    Transfer/sec: 6.71MB
    ```

    ##### Nginx + Go through FastCGI TCP

    ```shell
    # wrk -t100 -c5000 -d30s http://go.fcgi.tcp/
    Running 30s test @ http://go.fcgi.tcp/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 514.57ms 119.80ms 1.21s 71.85%
    Req/Sec 97.18 22.56 263.00 79.59%
    287416 requests in 30.00s, 48.24MB read
    Socket errors: connect 0, read 0, write 0, timeout 661
    Requests/sec: 9580.75
    Transfer/sec: 1.61MB
    ```

    ##### Nginx + Go through FastCGI Unix Socket

    ```shell
    # wrk -t100 -c5000 -d30s http://go.fcgi.unix/
    Running 30s test @ http://go.fcgi.unix/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 425.64ms 80.53ms 925.03ms 76.88%
    Req/Sec 117.03 22.13 255.00 81.30%
    350162 requests in 30.00s, 58.77MB read
    Socket errors: connect 0, read 0, write 0, timeout 210
    Requests/sec: 11670.72
    Transfer/sec: 1.96MB
    ```


    #### GOMAXPROCS = 8

    ##### Go standalone

    ```shell
    $ export GOMAXPROCS=8
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    $ sudo ab -k -c 4000 -n 100000 http://go.http/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    #### Compiled results

    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    *time taken (s)* | 2.144 | 5.438 | 10.776 | 9.360
    *reqs/second* | 46641.16 | 18,387.54 | 9,279.75 | 10,683.57
    *transfer rate (kb/s)* | 7,136,097.51 | 3,089,106.94 | 1,531,159.37 | 1,762,788.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | **1** | **1** | 7 | 32
    *max conn time (ms)* | **65** | 77 | 71 | 97
    *min proc time (ms)* | **0** | 100 | 47 | 95
    *avg proc time (ms)* | **81** | 212 | 419 | 337
    *max proc time (ms)* | **124** | 278 | 766 | 441
    *min total time (ms)* | **0** | 100 | 47 | 95
    *avg total time (ms)* | **82** | 213 | 426 | 369
    *max total time (ms)* | **189** | 355 | 837 | 538
    # wrk -t100 -c5000 -d30s http://127.0.0.1:8080/
    Running 30s test @ http://127.0.0.1:8080/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 39.25ms 8.49ms 86.45ms 81.39%
    Req/Sec 1.29k 129.27 1.79k 69.23%
    3837995 requests in 29.89s, 644.19MB read
    Requests/sec: 128402.88
    Transfer/sec: 21.55MB
    ```

    ##### Nginx + Go through HTTP

    ### Conclusions
    ```shell
    # wrk -t100 -c5000 -d30s http://go.http/
    Running 30s test @ http://go.http/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 336.77ms 297.88ms 632.52ms 60.16%
    Req/Sec 2.36k 2.99k 19.11k 84.83%
    2232068 requests in 29.98s, 374.64MB read
    Requests/sec: 74442.91
    Transfer/sec: 12.49MB
    ```

    ##### Nginx + Go through FastCGI TCP

    * If you don't need features from nginx I suggest you to stay with Go standalone. The nginx overhead looks huge and sometimes will not compensate the extra features.
    * If you still need nginx to do virtual hosting or some other fancy feature, **stay with the HTTP proxy config**
    ```shell
    # wrk -t100 -c5000 -d30s http://go.fcgi.tcp/
    Running 30s test @ http://go.fcgi.tcp/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 217.69ms 121.22ms 1.80s 75.14%
    Req/Sec 263.09 102.78 629.00 62.54%
    721027 requests in 30.01s, 121.02MB read
    Socket errors: connect 0, read 0, write 176, timeout 1343
    Requests/sec: 24026.50
    Transfer/sec: 4.03MB
    ```

    ##### Nginx + Go through FastCGI Unix Socket

    ```shell
    # wrk -t100 -c5000 -d30s http://go.fcgi.unix/
    Running 30s test @ http://go.fcgi.unix/
    100 threads and 5000 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 694.32ms 332.27ms 1.79s 62.13%
    Req/Sec 646.86 669.65 6.11k 87.80%
    909836 requests in 30.00s, 152.71MB read
    Requests/sec: 30324.77
    Transfer/sec: 5.09MB
    ```


    ### Conclusions

    The first set of benchmarks was made with `ab` and some nginx settings was not very well optimized (gzip was enabled and it was not using keep-alive connections with the Go backend). After changing to `wrk` and following the suggestions to optimize `nginx` the results gone very different.

    I don't know why the FastCGI middleware did so bad comparing to the HTTP one. Any ideas?
    The `nginx` overhead is not so big after all, however you probably want to use the HTTP proxy connection instead of FastCGI. Some folks said that Go's FastCGI is not well optimized and this may be the cause of the huge differences in the results presented here.
  7. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 19 additions and 19 deletions.
    38 changes: 19 additions & 19 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -26,25 +26,25 @@ Today I just wanted to know which of these options is faster:
    ### Kernel

    ```
    fs.file-max 9999999
    fs.nr_open 9999999
    net.core.netdev_max_backlog 4096
    net.core.rmem_max 16777216
    net.core.somaxconn 65535
    net.core.wmem_max 16777216
    net.ipv4.ip_forward 0
    net.ipv4.ip_local_port_range 1025 65535
    net.ipv4.tcp_fin_timeout 30
    net.ipv4.tcp_keepalive_time 30
    net.ipv4.tcp_max_syn_backlog 20480
    net.ipv4.tcp_max_tw_buckets 400000
    net.ipv4.tcp_no_metrics_save 1
    net.ipv4.tcp_syn_retries 2
    net.ipv4.tcp_synack_retries 2
    net.ipv4.tcp_tw_recycle 1
    net.ipv4.tcp_tw_reuse 1
    vm.min_free_kbytes 65536
    vm.overcommit_memory 1
    fs.file-max 9999999
    fs.nr_open 9999999
    net.core.netdev_max_backlog 4096
    net.core.rmem_max 16777216
    net.core.somaxconn 65535
    net.core.wmem_max 16777216
    net.ipv4.ip_forward 0
    net.ipv4.ip_local_port_range 1025 65535
    net.ipv4.tcp_fin_timeout 30
    net.ipv4.tcp_keepalive_time 30
    net.ipv4.tcp_max_syn_backlog 20480
    net.ipv4.tcp_max_tw_buckets 400000
    net.ipv4.tcp_no_metrics_save 1
    net.ipv4.tcp_syn_retries 2
    net.ipv4.tcp_synack_retries 2
    net.ipv4.tcp_tw_recycle 1
    net.ipv4.tcp_tw_reuse 1
    vm.min_free_kbytes 65536
    vm.overcommit_memory 1
    ```

    ### Nginx
  8. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 21 additions and 21 deletions.
    42 changes: 21 additions & 21 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -25,27 +25,27 @@ Today I just wanted to know which of these options is faster:

    ### Kernel

    Entry | Value
    ---: | :---:
    `fs.file-max` | `9999999`
    `fs.nr_open` | `9999999`
    `net.core.netdev_max_backlog` | `4096`
    `net.core.rmem_max` | `16777216`
    `net.core.somaxconn` | `65535`
    `net.core.wmem_max` | `16777216`
    `net.ipv4.ip_forward` | `0`
    `net.ipv4.ip_local_port_range` | `1025 65535`
    `net.ipv4.tcp_fin_timeout` | `30`
    `net.ipv4.tcp_keepalive_time` | `30`
    `net.ipv4.tcp_max_syn_backlog` | `20480`
    `net.ipv4.tcp_max_tw_buckets` | `400000`
    `net.ipv4.tcp_no_metrics_save` | `1`
    `net.ipv4.tcp_syn_retries` | `2`
    `net.ipv4.tcp_synack_retries` | `2`
    `net.ipv4.tcp_tw_recycle` | `1`
    `net.ipv4.tcp_tw_reuse` | `1`
    `vm.min_free_kbytes` | `65536`
    `vm.overcommit_memory` | `1`
    ```
    fs.file-max 9999999
    fs.nr_open 9999999
    net.core.netdev_max_backlog 4096
    net.core.rmem_max 16777216
    net.core.somaxconn 65535
    net.core.wmem_max 16777216
    net.ipv4.ip_forward 0
    net.ipv4.ip_local_port_range 1025 65535
    net.ipv4.tcp_fin_timeout 30
    net.ipv4.tcp_keepalive_time 30
    net.ipv4.tcp_max_syn_backlog 20480
    net.ipv4.tcp_max_tw_buckets 400000
    net.ipv4.tcp_no_metrics_save 1
    net.ipv4.tcp_syn_retries 2
    net.ipv4.tcp_synack_retries 2
    net.ipv4.tcp_tw_recycle 1
    net.ipv4.tcp_tw_reuse 1
    vm.min_free_kbytes 65536
    vm.overcommit_memory 1
    ```

    ### Nginx

  9. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Benchmarking Nginx with Go

    Today I just wanted to know which of this combination is faster from the following:
    Today I just wanted to know which of these options is faster:

    * Go HTTP standalone
    * Nginx proxy to Go HTTP
  10. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Benchmarking Nginx with Go and it's different interfaces
    # Benchmarking Nginx with Go

    Today I just wanted to know which of this combination is faster from the following:

  11. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -93,8 +93,8 @@ http {
    server {
    listen 80;
    server_name go.http;
    access_log /var/log/nginx/go.http.access.log combined buffer=128k;
    error_log /var/log/nginx/go.http.error.log warn;
    access_log off;
    error_log /dev/null crit;
    location / {
    proxy_pass http://127.0.0.1:8080;
    @@ -104,8 +104,8 @@ server {
    server {
    listen 80;
    server_name go.fcgi.tcp;
    access_log /var/log/nginx/go.fcgi.tcp.access.log combined buffer=128k;
    error_log /var/log/nginx/go.fcgi.tcp.error.log warn;
    access_log off;
    error_log /dev/null crit;
    location / {
    include fastcgi_params;
    @@ -116,8 +116,8 @@ server {
    server {
    listen 80;
    server_name go.fcgi.unix;
    access_log /var/log/nginx/go.fcgi.unix.access.log combined buffer=128k;
    error_log /var/log/nginx/go.fcgi.unix.error.log warn;
    access_log off;
    error_log /dev/null crit;
    location / {
    include fastcgi_params;
  12. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 21 additions and 17 deletions.
    38 changes: 21 additions & 17 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -201,14 +201,14 @@ Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    *reqs/second* | 46517.04 | 17,454.89 | 9,264.48 | 10944.05
    *transfer rate (kb/s)* | 7,117,106.64 | 2,932,422.33 | 1,528,639.76 | 1,805,768.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | 1 | 1 | 8 | 32
    *max conn time (ms)* | 72 | 85 | 74 | 88
    *min proc time (ms)* | 0 | 100 | 102 | 91
    *avg proc time (ms)* | 81 | 223 | 418 | 329
    *max proc time (ms)* | 55 | 333 | 674 | 426
    *min total time (ms)* | 0 | 100 | 102 | 91
    *avg total time (ms)* | 82 | 224 | 426 | 361
    *max total time (ms)* | 127 | 418 | 748 | 514
    *avg conn time (ms)* | **1** | **1** | 8 | 32
    *max conn time (ms)* | **72** | 85 | 74 | 88
    *min proc time (ms)* | **0** | 100 | 102 | 91
    *avg proc time (ms)* | **81** | 223 | 418 | 329
    *max proc time (ms)* | **55** | 333 | 674 | 426
    *min total time (ms)* | **0** | 100 | 102 | 91
    *avg total time (ms)* | **82** | 224 | 426 | 361
    *max total time (ms)* | **127** | 418 | 748 | 514


    #### GOMAXPROCS = 8
    @@ -230,16 +230,20 @@ Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    *reqs/second* | 46641.16 | 18,387.54 | 9,279.75 | 10,683.57
    *transfer rate (kb/s)* | 7,136,097.51 | 3,089,106.94 | 1,531,159.37 | 1,762,788.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | 1 | 1 | 7 | 32
    *max conn time (ms)* | 65 | 77 | 71 | 97
    *min proc time (ms)* | 0 | 100 | 47 | 95
    *avg proc time (ms)* | 81 | 212 | 419 | 337
    *max proc time (ms)* | 124 | 278 | 766 | 441
    *min total time (ms)* | 0 | 100 | 47 | 95
    *avg total time (ms)* | 82 | 213 | 426 | 369
    *max total time (ms)* | 189 | 355 | 837 | 538
    *avg conn time (ms)* | **1** | **1** | 7 | 32
    *max conn time (ms)* | **65** | 77 | 71 | 97
    *min proc time (ms)* | **0** | 100 | 47 | 95
    *avg proc time (ms)* | **81** | 212 | 419 | 337
    *max proc time (ms)* | **124** | 278 | 766 | 441
    *min total time (ms)* | **0** | 100 | 47 | 95
    *avg total time (ms)* | **82** | 213 | 426 | 369
    *max total time (ms)* | **189** | 355 | 837 | 538


    ### Conclusions

    If you don't need complex features from Nginx I suggest you to keep with Go standalone
    * If you don't need features from nginx I suggest you to stay with Go standalone. The nginx overhead looks huge and sometimes will not compensate the extra features.
    * If you still need nginx to do virtual hosting or some other fancy feature, **stay with the HTTP proxy config**


    I don't know why the FastCGI middleware did so bad comparing to the HTTP one. Any ideas?
  13. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 24 additions and 24 deletions.
    48 changes: 24 additions & 24 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -197,18 +197,18 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.15 | 5.729 | 10.794 | 9.137
    reqs/second | 46517.04 | 17,454.89 | 9,264.48 | 10944.05
    transfer rate (kb/s) | 7,117,106.64 | 2,932,422.33 | 1,528,639.76 | 1,805,768.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 8 | 32
    max conn time (ms) | 72 | 85 | 74 | 88
    min proc time (ms) | 0 | 100 | 102 | 91
    avg proc time (ms) | 81 | 223 | 418 | 329
    max proc time (ms) | 55 | 333 | 674 | 426
    min total time (ms) | 0 | 100 | 102 | 91
    avg total time (ms) | 82 | 224 | 426 | 361
    max total time (ms) | 127 | 418 | 748 | 514
    *time taken (s)* | 2.15 | 5.729 | 10.794 | 9.137
    *reqs/second* | 46517.04 | 17,454.89 | 9,264.48 | 10944.05
    *transfer rate (kb/s)* | 7,117,106.64 | 2,932,422.33 | 1,528,639.76 | 1,805,768.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | 1 | 1 | 8 | 32
    *max conn time (ms)* | 72 | 85 | 74 | 88
    *min proc time (ms)* | 0 | 100 | 102 | 91
    *avg proc time (ms)* | 81 | 223 | 418 | 329
    *max proc time (ms)* | 55 | 333 | 674 | 426
    *min total time (ms)* | 0 | 100 | 102 | 91
    *avg total time (ms)* | 82 | 224 | 426 | 361
    *max total time (ms)* | 127 | 418 | 748 | 514


    #### GOMAXPROCS = 8
    @@ -226,18 +226,18 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.144 | 5.438 | 10.776 | 9.360
    reqs/second | 46641.16 | 18,387.54 | 9,279.75 | 10,683.57
    transfer rate (kb/s) | 7,136,097.51 | 3,089,106.94 | 1,531,159.37 | 1,762,788.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 7 | 32
    max conn time (ms) | 65 | 77 | 71 | 97
    min proc time (ms) | 0 | 100 | 47 | 95
    avg proc time (ms) | 81 | 212 | 419 | 337
    max proc time (ms) | 124 | 278 | 766 | 441
    min total time (ms) | 0 | 100 | 47 | 95
    avg total time (ms) | 82 | 213 | 426 | 369
    max total time (ms) | 189 | 355 | 837 | 538
    *time taken (s)* | 2.144 | 5.438 | 10.776 | 9.360
    *reqs/second* | 46641.16 | 18,387.54 | 9,279.75 | 10,683.57
    *transfer rate (kb/s)* | 7,136,097.51 | 3,089,106.94 | 1,531,159.37 | 1,762,788.68
    *min conn time (ms)* | 0 | 0 | 0 | 0
    *avg conn time (ms)* | 1 | 1 | 7 | 32
    *max conn time (ms)* | 65 | 77 | 71 | 97
    *min proc time (ms)* | 0 | 100 | 47 | 95
    *avg proc time (ms)* | 81 | 212 | 419 | 337
    *max proc time (ms)* | 124 | 278 | 766 | 441
    *min total time (ms)* | 0 | 100 | 47 | 95
    *avg total time (ms)* | 82 | 213 | 426 | 369
    *max total time (ms)* | 189 | 355 | 837 | 538


    ### Conclusions
  14. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -198,8 +198,8 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.15 | 5.729 | 10.794 | 9.137
    reqs/second | 46517.04 | 17454.89 | 9264.48 | 10944.05
    transfer rate (kb/s) | 7117106.64 | 2932422.33 | 1528639.76 | 1805768.68
    reqs/second | 46517.04 | 17,454.89 | 9,264.48 | 10944.05
    transfer rate (kb/s) | 7,117,106.64 | 2,932,422.33 | 1,528,639.76 | 1,805,768.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 8 | 32
    max conn time (ms) | 72 | 85 | 74 | 88
    @@ -227,8 +227,8 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.144 | 5.438 | 10.776 | 9.360
    reqs/second | 46641.16 | 18387.54 | 9279.75 | 10683.57
    transfer rate (kb/s) | 7136097.51 | 3089106.94 | 1531159.37 | 1762788.68
    reqs/second | 46641.16 | 18,387.54 | 9,279.75 | 10,683.57
    transfer rate (kb/s) | 7,136,097.51 | 3,089,106.94 | 1,531,159.37 | 1,762,788.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 7 | 32
    max conn time (ms) | 65 | 77 | 71 | 97
  15. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,7 @@ Today I just wanted to know which of this combination is faster from the followi

    ### Kernel

    Entry | Value
    ---: | :---:
    `fs.file-max` | `9999999`
    `fs.nr_open` | `9999999`
  16. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,7 @@ Today I just wanted to know which of this combination is faster from the followi

    ### Kernel

    ---: | :---:
    `fs.file-max` | `9999999`
    `fs.nr_open` | `9999999`
    `net.core.netdev_max_backlog` | `4096`
  17. Herbert G. Fischer revised this gist Dec 15, 2013. 1 changed file with 19 additions and 19 deletions.
    38 changes: 19 additions & 19 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -25,25 +25,25 @@ Today I just wanted to know which of this combination is faster from the followi

    ### Kernel

    * `fs.file-max : 9999999`
    * `fs.nr_open : 9999999`
    * `net.core.netdev_max_backlog : 4096`
    * `net.core.rmem_max : 16777216`
    * `net.core.somaxconn : 65535`
    * `net.core.wmem_max : 16777216`
    * `net.ipv4.ip_forward : 0`
    * `net.ipv4.ip_local_port_range : 1025 65535`
    * `net.ipv4.tcp_fin_timeout : 30`
    * `net.ipv4.tcp_keepalive_time : 30`
    * `net.ipv4.tcp_max_syn_backlog : 20480`
    * `net.ipv4.tcp_max_tw_buckets : 400000`
    * `net.ipv4.tcp_no_metrics_save : 1`
    * `net.ipv4.tcp_syn_retries : 2`
    * `net.ipv4.tcp_synack_retries : 2`
    * `net.ipv4.tcp_tw_recycle : 1`
    * `net.ipv4.tcp_tw_reuse : 1`
    * `vm.min_free_kbytes : 65536`
    * `vm.overcommit_memory : 1`
    `fs.file-max` | `9999999`
    `fs.nr_open` | `9999999`
    `net.core.netdev_max_backlog` | `4096`
    `net.core.rmem_max` | `16777216`
    `net.core.somaxconn` | `65535`
    `net.core.wmem_max` | `16777216`
    `net.ipv4.ip_forward` | `0`
    `net.ipv4.ip_local_port_range` | `1025 65535`
    `net.ipv4.tcp_fin_timeout` | `30`
    `net.ipv4.tcp_keepalive_time` | `30`
    `net.ipv4.tcp_max_syn_backlog` | `20480`
    `net.ipv4.tcp_max_tw_buckets` | `400000`
    `net.ipv4.tcp_no_metrics_save` | `1`
    `net.ipv4.tcp_syn_retries` | `2`
    `net.ipv4.tcp_synack_retries` | `2`
    `net.ipv4.tcp_tw_recycle` | `1`
    `net.ipv4.tcp_tw_reuse` | `1`
    `vm.min_free_kbytes` | `65536`
    `vm.overcommit_memory` | `1`

    ### Nginx

  18. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 19 additions and 19 deletions.
    38 changes: 19 additions & 19 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -25,25 +25,25 @@ Today I just wanted to know which of this combination is faster from the followi

    ### Kernel

    * ```fs.file-max : 9999999```
    * ```fs.nr_open : 9999999```
    * ```net.core.netdev_max_backlog : 4096```
    * ```net.core.rmem_max : 16777216```
    * ```net.core.somaxconn : 65535```
    * ```net.core.wmem_max : 16777216```
    * ```net.ipv4.ip_forward : 0```
    * ```net.ipv4.ip_local_port_range : 1025 65535```
    * ```net.ipv4.tcp_fin_timeout : 30```
    * ```net.ipv4.tcp_keepalive_time : 30```
    * ```net.ipv4.tcp_max_syn_backlog : 20480```
    * ```net.ipv4.tcp_max_tw_buckets : 400000```
    * ```net.ipv4.tcp_no_metrics_save : 1```
    * ```net.ipv4.tcp_syn_retries : 2```
    * ```net.ipv4.tcp_synack_retries : 2```
    * ```net.ipv4.tcp_tw_recycle : 1```
    * ```net.ipv4.tcp_tw_reuse : 1```
    * ```vm.min_free_kbytes : 65536```
    * ```vm.overcommit_memory : 1```
    * `fs.file-max : 9999999`
    * `fs.nr_open : 9999999`
    * `net.core.netdev_max_backlog : 4096`
    * `net.core.rmem_max : 16777216`
    * `net.core.somaxconn : 65535`
    * `net.core.wmem_max : 16777216`
    * `net.ipv4.ip_forward : 0`
    * `net.ipv4.ip_local_port_range : 1025 65535`
    * `net.ipv4.tcp_fin_timeout : 30`
    * `net.ipv4.tcp_keepalive_time : 30`
    * `net.ipv4.tcp_max_syn_backlog : 20480`
    * `net.ipv4.tcp_max_tw_buckets : 400000`
    * `net.ipv4.tcp_no_metrics_save : 1`
    * `net.ipv4.tcp_syn_retries : 2`
    * `net.ipv4.tcp_synack_retries : 2`
    * `net.ipv4.tcp_tw_recycle : 1`
    * `net.ipv4.tcp_tw_reuse : 1`
    * `vm.min_free_kbytes : 65536`
    * `vm.overcommit_memory : 1`

    ### Nginx

  19. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 23 additions and 2 deletions.
    25 changes: 23 additions & 2 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -196,6 +196,17 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.15 | 5.729 | 10.794 | 9.137
    reqs/second | 46517.04 | 17454.89 | 9264.48 | 10944.05
    transfer rate (kb/s) | 7117106.64 | 2932422.33 | 1528639.76 | 1805768.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 8 | 32
    max conn time (ms) | 72 | 85 | 74 | 88
    min proc time (ms) | 0 | 100 | 102 | 91
    avg proc time (ms) | 81 | 223 | 418 | 329
    max proc time (ms) | 55 | 333 | 674 | 426
    min total time (ms) | 0 | 100 | 102 | 91
    avg total time (ms) | 82 | 224 | 426 | 361
    max total time (ms) | 127 | 418 | 748 | 514


    #### GOMAXPROCS = 8
    @@ -213,8 +224,18 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.144 | 5.438 | 10.776 | 9.36

    time taken (s) | 2.144 | 5.438 | 10.776 | 9.360
    reqs/second | 46641.16 | 18387.54 | 9279.75 | 10683.57
    transfer rate (kb/s) | 7136097.51 | 3089106.94 | 1531159.37 | 1762788.68
    min conn time (ms) | 0 | 0 | 0 | 0
    avg conn time (ms) | 1 | 1 | 7 | 32
    max conn time (ms) | 65 | 77 | 71 | 97
    min proc time (ms) | 0 | 100 | 47 | 95
    avg proc time (ms) | 81 | 212 | 419 | 337
    max proc time (ms) | 124 | 278 | 766 | 441
    min total time (ms) | 0 | 100 | 47 | 95
    avg total time (ms) | 82 | 213 | 426 | 369
    max total time (ms) | 189 | 355 | 837 | 538


    ### Conclusions
  20. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -193,9 +193,9 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    #### Compiled results

    Metric | MaxProcs | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:|
    time taken (s) | 1 | 2.15 | 5.729 | 10.794 | 9.137
    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.15 | 5.729 | 10.794 | 9.137


    #### GOMAXPROCS = 8
    @@ -211,9 +211,9 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    #### Compiled results

    Metric | MaxProcs | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:|
    time taken (s) | 8 | 2.144 | 5.438 | 10.776 | 9.36
    Metric | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:
    time taken (s) | 2.144 | 5.438 | 10.776 | 9.36



  21. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -191,11 +191,11 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    ##### Compiled results
    #### Compiled results

    Metric | Go | Nginx+Go HTTP | Nginx+Go FastCGI TCP | Nginx + Go FastCGI unix
    Metric | MaxProcs | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:|

    time taken (s) | 1 | 2.15 | 5.729 | 10.794 | 9.137


    #### GOMAXPROCS = 8
    @@ -209,7 +209,11 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    ##### Compiled results
    #### Compiled results

    Metric | MaxProcs | Go | Nginx+Go HTTP | Nginx+Go FCGI tcp | Nginx+Go FCGI unix
    ---:|:---:|:---:|:---:|:---:|
    time taken (s) | 8 | 2.144 | 5.438 | 10.776 | 9.36



  22. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -193,7 +193,9 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    ##### Compiled results

    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="188"/><col width="94"/><col width="85"/><col width="106"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/></colgroup><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.15</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46517.04</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7117106.64</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>72</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>55</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>127</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>17454.89</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>2932422.33</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>85</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>223</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>333</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>224</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9264.48</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1528639.76</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>8</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>74</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>674</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>748</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10944.05</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1805768.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>88</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>329</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>361</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>514</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46641.16</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7136097.51</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>65</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>124</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>189</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>18387.54</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>3089106.94</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>77</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>212</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>278</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>213</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>355</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9279.75</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1531159.37</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>7</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>71</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>419</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>766</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>837</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.36</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10683.57</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1762788.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>97</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>337</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>441</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>369</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>538</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr></table>
    Metric | Go | Nginx+Go HTTP | Nginx+Go FastCGI TCP | Nginx + Go FastCGI unix
    ---:|:---:|:---:|:---:|:---:|



    #### GOMAXPROCS = 8
    @@ -209,7 +211,7 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    ##### Compiled results

    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="188"/><col width="94"/><col width="85"/><col width="106"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/></colgroup><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.15</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46517.04</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7117106.64</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>72</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>55</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>127</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>17454.89</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>2932422.33</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>85</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>223</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>333</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>224</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9264.48</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1528639.76</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>8</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>74</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>674</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>748</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10944.05</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1805768.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>88</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>329</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>361</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>514</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46641.16</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7136097.51</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>65</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>124</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>189</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>18387.54</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>3089106.94</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>77</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>212</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>278</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>213</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>355</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9279.75</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1531159.37</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>7</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>71</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>419</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>766</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>837</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.36</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10683.57</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1762788.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>97</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>337</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>441</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>369</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>538</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr></table>


    ### Conclusions

  23. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Benchmarking Nginx with Go and it's different interfaces

    Today I just wanted to know which of this combination is faster:
    Today I just wanted to know which of this combination is faster from the following:

    * Go HTTP standalone
    * Nginx proxy to Go HTTP
    @@ -193,6 +193,7 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    ##### Compiled results

    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="188"/><col width="94"/><col width="85"/><col width="106"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/></colgroup><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.15</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46517.04</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7117106.64</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>72</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>55</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>127</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>17454.89</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>2932422.33</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>85</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>223</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>333</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>224</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9264.48</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1528639.76</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>8</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>74</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>674</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>748</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10944.05</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1805768.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>88</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>329</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>361</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>514</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46641.16</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7136097.51</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>65</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>124</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>189</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>18387.54</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>3089106.94</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>77</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>212</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>278</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>213</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>355</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9279.75</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1531159.37</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>7</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>71</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>419</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>766</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>837</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.36</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10683.57</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1762788.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>97</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>337</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>441</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>369</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>538</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr></table>


    #### GOMAXPROCS = 8
    @@ -208,7 +209,7 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    ##### Compiled results


    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="188"/><col width="94"/><col width="85"/><col width="106"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/><col width="45"/></colgroup><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.15</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46517.04</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7117106.64</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>72</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>55</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>127</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>17454.89</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>2932422.33</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>85</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>223</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>333</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>224</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9264.48</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1528639.76</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>8</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>74</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>418</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>674</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>102</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>748</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10944.05</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1805768.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>88</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>329</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>91</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>361</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>514</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce3"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce3"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce3"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Conn Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Proc. Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.4071in; " class="ce4"><p>Total Time (ms)</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce1"> </td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>min</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>avg</p></td><td style="text-align:left;width:0.4071in; " class="ce4"><p>max</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Go</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>46641.16</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>7136097.51</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>65</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>81</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>124</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>82</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>189</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go HTTP</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>18387.54</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>3089106.94</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>1</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>77</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>212</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>278</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>100</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>213</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>355</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (tcp)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>9279.75</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1531159.37</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>7</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>71</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>419</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>766</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>47</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>426</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>837</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="ce2"><p>Nginx+Go FastCGI (unix)</p></td><td style="text-align:right; width:0.85in; " class="ce4"><p>9.36</p></td><td style="text-align:right; width:0.7646in; " class="ce4"><p>10683.57</p></td><td style="text-align:right; width:0.9575in; " class="ce4"><p>1762788.68</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>0</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>32</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>97</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>337</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>441</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>95</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>369</p></td><td style="text-align:right; width:0.4071in; " class="ce4"><p>538</p></td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr><tr class="ro1"><td style="text-align:left;width:1.6972in; " class="Default"> </td><td style="text-align:left;width:0.85in; " class="ce5"> </td><td style="text-align:left;width:0.7646in; " class="ce5"> </td><td style="text-align:left;width:0.9575in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td><td style="text-align:left;width:0.4071in; " class="ce5"> </td></tr></table>

    ### Conclusions

  24. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Benchmark Nginx + Go and it's different interfaces
    # Benchmarking Nginx with Go and it's different interfaces

    Today I just wanted to know which of this combination is faster:

  25. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -180,13 +180,24 @@ func main() {

    ### The benchmarks

    #### GOMAXPROCS = 1

    ```shell
    $ export GOMAXPROCS=1
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    $ sudo ab -k -c 4000 -n 100000 http://go.http/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    ##### Compiled results



    #### GOMAXPROCS = 8

    ```shell
    $ export GOMAXPROCS=8
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    @@ -195,10 +206,10 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    ### Compiled results
    ##### Compiled results



    ## Conclusions
    ### Conclusions

    If you don't need complex features from Nginx I suggest you to keep with Go standalone
  26. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ Today I just wanted to know which of this combination is faster:

    ### Nginx

    ```nginx.conf
    ```nginx
    user www-data;
    worker_processes 16;
    worker_rlimit_nofile 200000;
    @@ -180,7 +180,7 @@ func main() {

    ### The benchmarks

    ```
    ```shell
    $ export GOMAXPROCS=1
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    @@ -197,7 +197,7 @@ $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/

    ### Compiled results

    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="246"/><col width="127"/><col width="94"/><col width="85"/><col width="106"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="99"/></colgroup><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:1.1398in; " class="ce5"><p>GOMAXPROCS</p></td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce9"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce15"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce5"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Connection Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Processing Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Total Time (ms)</p></td><td style="text-align:left;width:0.889in; " class="ce23"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce1"> </td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.889in; " class="ce23"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Go HTTP standalone</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>2.150</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>46517</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>7117106.64</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>72</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>81</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>55</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>82</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>127</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go HTTP</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>17455</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>2932422.33</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>85</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>223</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>333</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>224</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>418</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go TCP FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce12"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce18"><p>9264</p></td><td style="text-align:right; width:0.9575in; " class="ce21"><p>1528639.76</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>74</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>102</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>418</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>674</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>102</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>748</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go Unix Socks FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>10944</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1805768.68</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>32</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>88</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>91</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>329</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>91</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>361</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>514</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Go HTTP standalone</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce13"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce19"><p>46641</p></td><td style="text-align:right; width:0.9575in; " class="ce22"><p>7136097.51</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>65</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>81</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>124</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>82</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>189</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go HTTP</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>18388</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>3089106.94</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>77</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>212</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>278</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>213</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>355</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go TCP FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>9280</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1531159.37</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>7</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>71</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>47</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>419</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>766</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>47</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>837</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go Unix Socks FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>9.360</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>10684</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1762788.68</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>32</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>97</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>95</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>337</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>441</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>95</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>369</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>538</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce4"> </td><td style="text-align:left;width:1.1398in; " class="ce8"> </td><td style="text-align:left;width:0.85in; " class="ce14"> </td><td style="text-align:left;width:0.7646in; " class="ce20"> </td><td style="text-align:left;width:0.9575in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce4"> </td><td style="text-align:left;width:1.1398in; " class="ce8"> </td><td style="text-align:left;width:0.85in; " class="ce14"> </td><td style="text-align:left;width:0.7646in; " class="ce20"> </td><td style="text-align:left;width:0.9575in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr></table>


    ## Conclusions

  27. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ Today I just wanted to know which of this combination is faster:

    ### Nginx

    ```
    ```nginx.conf
    user www-data;
    worker_processes 16;
    worker_rlimit_nofile 200000;
    @@ -87,7 +87,7 @@ http {

    ### Nginx vhosts

    ```
    ```nginx
    server {
    listen 80;
    server_name go.http;
    @@ -126,7 +126,7 @@ server {

    ### The Go code

    ```
    ```go
    package main

    import (
  28. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 15 additions and 228 deletions.
    243 changes: 15 additions & 228 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -178,239 +178,26 @@ func main() {
    * Load the server (```sudo su - www-data ./server```)


    ### The benchmarks with GOMAXPROCS = 1
    ### The benchmarks

    #### Go HTTP standalone

    ```
    # ab -w -k -c 4000 -n 100000 http://127.0.0.1:8080/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white></td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>127.0.0.1</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>8080</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>2.150 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>15300000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>46517.04</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>7117106.64 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 72</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 0</td><td bgcolor=white> 81</td><td bgcolor=white> 55</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 0</td><td bgcolor=white> 82</td><td bgcolor=white> 127</td></tr>
    </table>


    #### Nginx proxy to Go HTTP

    ```
    # ab -w -k -c 4000 -n 100000 http://go.http/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.http</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>5.729 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16800000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>17454.89</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>2932422.33 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 85</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 100</td><td bgcolor=white> 223</td><td bgcolor=white> 333</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 100</td><td bgcolor=white> 224</td><td bgcolor=white> 418</td></tr>
    </table>


    #### Nginx fastcgi to Go TCP FastCGI

    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.tcp/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.tcp</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>10.794 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>9264.48</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1528639.76 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 8</td><td bgcolor=white> 74</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 102</td><td bgcolor=white> 418</td><td bgcolor=white> 674</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 102</td><td bgcolor=white> 426</td><td bgcolor=white> 748</td></tr>
    </table>


    #### Nginx fastcgi to Go Unix Socket FastCGI
    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.unix</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>9.137 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>10944.05</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1805768.68 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 32</td><td bgcolor=white> 88</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 91</td><td bgcolor=white> 329</td><td bgcolor=white> 426</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 91</td><td bgcolor=white> 361</td><td bgcolor=white> 514</td></tr>
    </table>


    ### The benchmarks with GOMAXPROCS = 8

    #### Go HTTP standalone

    ```
    # ab -w -k -c 4000 -n 100000 http://127.0.0.1:8080/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white></td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>127.0.0.1</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>8080</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>2.144 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>15300000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>46641.16</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>7136097.51 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 65</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 0</td><td bgcolor=white> 81</td><td bgcolor=white> 124</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 0</td><td bgcolor=white> 82</td><td bgcolor=white> 189</td></tr>
    </table>


    #### Nginx proxy to Go HTTP

    ```
    # ab -w -k -c 4000 -n 100000 http://go.http/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.http</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>5.438 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16800000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>18387.54</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>3089106.94 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 77</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 100</td><td bgcolor=white> 212</td><td bgcolor=white> 278</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 100</td><td bgcolor=white> 213</td><td bgcolor=white> 355</td></tr>
    </table>


    #### Nginx fastcgi to Go TCP FastCGI

    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.tcp/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.tcp</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>10.776 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>9279.75</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1531159.37 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 7</td><td bgcolor=white> 71</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 47</td><td bgcolor=white> 419</td><td bgcolor=white> 766</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 47</td><td bgcolor=white> 426</td><td bgcolor=white> 837</td></tr>
    </table>


    #### Nginx fastcgi to Go Unix Socket FastCGI
    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.unix/
    $ export GOMAXPROCS=1
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    $ sudo ab -k -c 4000 -n 100000 http://go.http/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    $ export GOMAXPROCS=8
    $ sudo -u www-data ./server &
    $ sudo ab -k -c 4000 -n 100000 http://127.0.0.1:8080/
    $ sudo ab -k -c 4000 -n 100000 http://go.http/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.tcp/
    $ sudo ab -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.unix</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>9.360 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>10683.57</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1762788.68 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 32</td><td bgcolor=white> 97</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 95</td><td bgcolor=white> 337</td><td bgcolor=white> 441</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 95</td><td bgcolor=white> 369</td><td bgcolor=white> 538</td></tr>
    </table>
    ### Compiled results

    <table border="0" cellspacing="0" cellpadding="0" class="ta1"><colgroup><col width="246"/><col width="127"/><col width="94"/><col width="85"/><col width="106"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="61"/><col width="99"/></colgroup><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce1"> </td><td rowspan="2" style="text-align:left;width:1.1398in; " class="ce5"><p>GOMAXPROCS</p></td><td rowspan="2" style="text-align:left;width:0.85in; " class="ce9"><p>Time taken (secs)</p></td><td rowspan="2" style="text-align:left;width:0.7646in; " class="ce15"><p>Requests/second</p></td><td rowspan="2" style="text-align:left;width:0.9575in; " class="ce5"><p>Transfer rate (kb/s)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Connection Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Processing Time (ms)</p></td><td colspan="3" style="text-align:left;width:0.5465in; " class="ce5"><p>Total Time (ms)</p></td><td style="text-align:left;width:0.889in; " class="ce23"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce1"> </td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>min</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>avg</p></td><td style="text-align:left;width:0.5465in; " class="ce6"><p>max</p></td><td style="text-align:left;width:0.889in; " class="ce23"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Go HTTP standalone</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>2.150</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>46517</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>7117106.64</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>72</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>81</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>55</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>82</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>127</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go HTTP</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>5.729</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>17455</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>2932422.33</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>85</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>223</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>333</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>224</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>418</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go TCP FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce12"><p>10.794</p></td><td style="text-align:right; width:0.7646in; " class="ce18"><p>9264</p></td><td style="text-align:right; width:0.9575in; " class="ce21"><p>1528639.76</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>74</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>102</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>418</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>674</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>102</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>748</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce2"><p>Nginx + Go Unix Socks FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>1</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>9.137</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>10944</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1805768.68</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>32</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>88</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>91</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>329</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>91</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>361</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>514</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Go HTTP standalone</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce13"><p>2.144</p></td><td style="text-align:right; width:0.7646in; " class="ce19"><p>46641</p></td><td style="text-align:right; width:0.9575in; " class="ce22"><p>7136097.51</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>65</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>81</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>124</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>82</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>189</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go HTTP</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>5.438</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>18388</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>3089106.94</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>1</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>77</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>212</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>278</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>100</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>213</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>355</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go TCP FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>10.776</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>9280</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1531159.37</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>7</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>71</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>47</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>419</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>766</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>47</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>426</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>837</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce3"><p>Nginx + Go Unix Socks FastCGI</p></td><td style="text-align:right; width:1.1398in; " class="ce7"><p>8</p></td><td style="text-align:right; width:0.85in; " class="ce11"><p>9.360</p></td><td style="text-align:right; width:0.7646in; " class="ce17"><p>10684</p></td><td style="text-align:right; width:0.9575in; " class="ce7"><p>1762788.68</p></td><td style="text-align:right; width:0.5465in; " class="ce22"><p>0</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>32</p></td><td style="text-align:right; width:0.5465in; " class="ce21"><p>97</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>95</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>337</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>441</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>95</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>369</p></td><td style="text-align:right; width:0.5465in; " class="ce7"><p>538</p></td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce4"> </td><td style="text-align:left;width:1.1398in; " class="ce8"> </td><td style="text-align:left;width:0.85in; " class="ce14"> </td><td style="text-align:left;width:0.7646in; " class="ce20"> </td><td style="text-align:left;width:0.9575in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr><tr class="ro1"><td style="text-align:left;width:2.2189in; " class="ce4"> </td><td style="text-align:left;width:1.1398in; " class="ce8"> </td><td style="text-align:left;width:0.85in; " class="ce14"> </td><td style="text-align:left;width:0.7646in; " class="ce20"> </td><td style="text-align:left;width:0.9575in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.5465in; " class="ce8"> </td><td style="text-align:left;width:0.889in; " class="ce8"> </td></tr></table>

    ## Conclusions

  29. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 20 additions and 20 deletions.
    40 changes: 20 additions & 20 deletions benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Benchmark Nginx + Go and it's different interfaces
    # Benchmark Nginx + Go and it's different interfaces

    Today I just wanted to know which of this combination is faster:

    @@ -7,23 +7,23 @@ Today I just wanted to know which of this combination is faster:
    * Nginx fastcgi to Go TCP FastCGI
    * Nginx fastcgi to Go Unix Socket FastCGI

    ### Hardware
    ## Hardware

    * Samsung Laptop NP550P5C-AD1BR
    * Intel Core i7 3630QM @2.4GHz (quad core, 8 threads)
    * CPU caches: (L1: 256KiB, L2: 1MiB, L3: 6MiB)
    * RAM 8GiB DDR3 1600MHz

    ### Software
    ## Software

    * Ubuntu 13.10 amd64 Saucy Salamander (updated)
    * Nginx 1.4.4 (1.4.4-1~saucy0 amd64)
    * Go 1.2 (linux/amd64)
    * ApacheBench 2.3 Revision 1430300

    ### Settings
    ## Settings

    #### Kernel
    ### Kernel

    * ```fs.file-max : 9999999```
    * ```fs.nr_open : 9999999```
    @@ -45,7 +45,7 @@ Today I just wanted to know which of this combination is faster:
    * ```vm.min_free_kbytes : 65536```
    * ```vm.overcommit_memory : 1```

    #### Nginx
    ### Nginx

    ```
    user www-data;
    @@ -85,7 +85,7 @@ http {
    }
    ```

    #### Nginx vhosts
    ### Nginx vhosts

    ```
    server {
    @@ -124,7 +124,7 @@ server {
    }
    ```

    #### The Go code
    ### The Go code

    ```
    package main
    @@ -170,17 +170,17 @@ func main() {
    }
    ```

    #### Starting the engines
    ### Starting the engines

    * Configure kernel with sysctl
    * Configure nginx
    * Configure nginx vhosts
    * Load the server (```sudo su - www-data ./server```)


    #### The benchmarks with GOMAXPROCS = 1
    ### The benchmarks with GOMAXPROCS = 1

    ##### Go HTTP standalone
    #### Go HTTP standalone

    ```
    # ab -w -k -c 4000 -n 100000 http://127.0.0.1:8080/
    @@ -209,7 +209,7 @@ func main() {
    </table>


    ##### Nginx proxy to Go HTTP
    #### Nginx proxy to Go HTTP

    ```
    # ab -w -k -c 4000 -n 100000 http://go.http/
    @@ -238,7 +238,7 @@ func main() {
    </table>


    ##### Nginx fastcgi to Go TCP FastCGI
    #### Nginx fastcgi to Go TCP FastCGI

    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.tcp/
    @@ -267,7 +267,7 @@ func main() {
    </table>


    ##### Nginx fastcgi to Go Unix Socket FastCGI
    #### Nginx fastcgi to Go Unix Socket FastCGI
    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```
    @@ -295,9 +295,9 @@ func main() {
    </table>


    #### The benchmarks with GOMAXPROCS = 8
    ### The benchmarks with GOMAXPROCS = 8

    ##### Go HTTP standalone
    #### Go HTTP standalone

    ```
    # ab -w -k -c 4000 -n 100000 http://127.0.0.1:8080/
    @@ -326,7 +326,7 @@ func main() {
    </table>


    ##### Nginx proxy to Go HTTP
    #### Nginx proxy to Go HTTP

    ```
    # ab -w -k -c 4000 -n 100000 http://go.http/
    @@ -355,7 +355,7 @@ func main() {
    </table>


    ##### Nginx fastcgi to Go TCP FastCGI
    #### Nginx fastcgi to Go TCP FastCGI

    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.tcp/
    @@ -384,7 +384,7 @@ func main() {
    </table>


    ##### Nginx fastcgi to Go Unix Socket FastCGI
    #### Nginx fastcgi to Go Unix Socket FastCGI
    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```
    @@ -412,6 +412,6 @@ func main() {
    </table>


    ### Conclusions
    ## Conclusions

    If you don't need complex features from Nginx I suggest you to keep with Go standalone
  30. Herbert G. Fischer revised this gist Dec 14, 2013. 1 changed file with 123 additions and 1 deletion.
    124 changes: 123 additions & 1 deletion benchmark+go+nginx.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Today I just wanted to know which of this combination is faster:
    ### Hardware

    * Samsung Laptop NP550P5C-AD1BR
    * Intel Core i7 3630QM @2.4GHz
    * Intel Core i7 3630QM @2.4GHz (quad core, 8 threads)
    * CPU caches: (L1: 256KiB, L2: 1MiB, L3: 6MiB)
    * RAM 8GiB DDR3 1600MHz

    @@ -293,3 +293,125 @@ func main() {
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 91</td><td bgcolor=white> 329</td><td bgcolor=white> 426</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 91</td><td bgcolor=white> 361</td><td bgcolor=white> 514</td></tr>
    </table>


    #### The benchmarks with GOMAXPROCS = 8

    ##### Go HTTP standalone

    ```
    # ab -w -k -c 4000 -n 100000 http://127.0.0.1:8080/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white></td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>127.0.0.1</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>8080</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>2.144 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>15300000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>46641.16</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>7136097.51 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 65</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 0</td><td bgcolor=white> 81</td><td bgcolor=white> 124</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 0</td><td bgcolor=white> 82</td><td bgcolor=white> 189</td></tr>
    </table>


    ##### Nginx proxy to Go HTTP

    ```
    # ab -w -k -c 4000 -n 100000 http://go.http/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.http</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>5.438 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16800000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>18387.54</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>3089106.94 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 1</td><td bgcolor=white> 77</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 100</td><td bgcolor=white> 212</td><td bgcolor=white> 278</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 100</td><td bgcolor=white> 213</td><td bgcolor=white> 355</td></tr>
    </table>


    ##### Nginx fastcgi to Go TCP FastCGI

    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.tcp/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.tcp</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>10.776 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>9279.75</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1531159.37 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 7</td><td bgcolor=white> 71</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 47</td><td bgcolor=white> 419</td><td bgcolor=white> 766</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 47</td><td bgcolor=white> 426</td><td bgcolor=white> 837</td></tr>
    </table>


    ##### Nginx fastcgi to Go Unix Socket FastCGI
    ```
    # ab -w -k -c 4000 -n 100000 http://go.fcgi.unix/
    ```

    <table >
    <tr ><th colspan=2 bgcolor=white>Server Software:</th><td colspan=2 bgcolor=white>nginx</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Hostname:</th><td colspan=2 bgcolor=white>go.fcgi.unix</td></tr>
    <tr ><th colspan=2 bgcolor=white>Server Port:</th><td colspan=2 bgcolor=white>80</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Path:</th><td colspan=2 bgcolor=white>/</td></tr>
    <tr ><th colspan=2 bgcolor=white>Document Length:</th><td colspan=2 bgcolor=white>12 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Concurrency Level:</th><td colspan=2 bgcolor=white>4000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Time taken for tests:</th><td colspan=2 bgcolor=white>9.360 seconds</td></tr>
    <tr ><th colspan=2 bgcolor=white>Complete requests:</th><td colspan=2 bgcolor=white>100000</td></tr>
    <tr ><th colspan=2 bgcolor=white>Failed requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Keep-Alive requests:</th><td colspan=2 bgcolor=white>0</td></tr>
    <tr ><th colspan=2 bgcolor=white>Total transferred:</th><td colspan=2 bgcolor=white>16500000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>HTML transferred:</th><td colspan=2 bgcolor=white>1200000 bytes</td></tr>
    <tr ><th colspan=2 bgcolor=white>Requests per second:</th><td colspan=2 bgcolor=white>10683.57</td></tr>
    <tr ><th colspan=2 bgcolor=white>Transfer rate:</th><td colspan=2 bgcolor=white>1762788.68 kb/s received</td></tr>
    <tr ><th bgcolor=white colspan=4>Connnection Times (ms)</th></tr>
    <tr ><th bgcolor=white>&nbsp;</th> <th bgcolor=white>min</th> <th bgcolor=white>avg</th> <th bgcolor=white>max</th></tr>
    <tr ><th bgcolor=white>Connect:</th><td bgcolor=white> 0</td><td bgcolor=white> 32</td><td bgcolor=white> 97</td></tr>
    <tr ><th bgcolor=white>Processing:</th><td bgcolor=white> 95</td><td bgcolor=white> 337</td><td bgcolor=white> 441</td></tr>
    <tr ><th bgcolor=white>Total:</th><td bgcolor=white> 95</td><td bgcolor=white> 369</td><td bgcolor=white> 538</td></tr>
    </table>


    ### Conclusions

    If you don't need complex features from Nginx I suggest you to keep with Go standalone