News for hackers. Stuff that matters.
Re:Go as an alternative to Node.js for Very Fast Servers by mjijackson on Friday February 22, 2013 @01:26PM (#5265720)
I was curious, so I actually ran both of the servers from the article on my little MacBook Air. The results are below.

First, go:

    $ ab -c 100 -n 10000 http://localhost:8000/
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking localhost (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests


    Server Software:        
    Server Hostname:        localhost
    Server Port:            8000

    Document Path:          /
    Document Length:        1048576 bytes

    Concurrency Level:      100
    Time taken for tests:   10.085 seconds
    Complete requests:      10000
    Failed requests:        0
    Write errors:           0
    Total transferred:      10489017384 bytes
    HTML transferred:       10487857152 bytes
    Requests per second:    991.62 [#/sec] (mean)
    Time per request:       100.846 [ms] (mean)
    Time per request:       1.008 [ms] (mean, across all concurrent requests)
    Transfer rate:          1015729.90 [Kbytes/sec] received

    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        1    2   0.8      2       6
    Processing:    21   99   5.6     98     137
    Waiting:        1    3   2.7      2      41
    Total:         25  101   5.6    101     139

    Percentage of the requests served within a certain time (ms)
      50%    101
      66%    102
      75%    103
      80%    103
      90%    105
      95%    106
      98%    108
      99%    112
     100%    139 (longest request)
     
Secondly, node.js:

    $ ab -c 100 -n 10000 http://localhost:8000/
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking localhost (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests


    Server Software:        
    Server Hostname:        localhost
    Server Port:            8000

    Document Path:          /
    Document Length:        1048576 bytes

    Concurrency Level:      100
    Time taken for tests:   15.765 seconds
    Complete requests:      10000
    Failed requests:        0
    Write errors:           0
    Total transferred:      10487558651 bytes
    HTML transferred:       10486808576 bytes
    Requests per second:    634.31 [#/sec] (mean)
    Time per request:       157.653 [ms] (mean)
    Time per request:       1.577 [ms] (mean, across all concurrent requests)
    Transfer rate:          649639.92 [Kbytes/sec] received

    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    1   1.7      1      11
    Processing:     2  156  34.7    159     272
    Waiting:        1   47  29.7     42     136
    Total:          2  157  34.7    161     273

    Percentage of the requests served within a certain time (ms)
      50%    161
      66%    174
      75%    182
      80%    187
      90%    198
      95%    209
      98%    221
      99%    227
     100%    273 (longest request)
Not only does go serve the traffic more quickly, but it also has a much lower standard deviation between slow and long requests. Impressive.
Re:Go as an alternative to Node.js for Very Fast Servers by fizx on Friday February 22, 2013 @01:45PM (#5265841)
Benchmarking on macbooks is often an exercise in testing the mediocre default configuration of the network stack, not your language. My macbook pro gets 4k rps with apache, node, go, and nginx. YMMV and all that, but I'm always wary.
Re:Go as an alternative to Node.js for Very Fast Servers by newman314 on Friday February 22, 2013 @07:04PM (#5267797)
What configs do you change?
Re:Go as an alternative to Node.js for Very Fast Servers by fizx on Saturday February 23, 2013 @07:06PM (#5272034)
I usually just benchmark in a production environment.
Re:Go as an alternative to Node.js for Very Fast Servers by newman314 on Sunday February 24, 2013 @08:13AM (#5274076)
Clarification.

What did you change to get the claimed 4k rps on your Macbook?

Re:Go as an alternative to Node.js for Very Fast Servers by fizx on Sunday February 24, 2013 @05:16PM (#5276163)
Upgraded from air to pro ;)
Re:Go as an alternative to Node.js for Very Fast Servers by oinksoft on Friday February 22, 2013 @01:42PM (#5265818)
I'd be interested to see your numbers benchmarking with `siege' rather than `ab'.
Re:Go as an alternative to Node.js for Very Fast Servers by pooriaazimi on Friday February 22, 2013 @06:59PM (#5267767)
I really love 'siege'. I wonder if you can get it show you response-time percentiles (or whatever they're called). I mean this (from `ab`):

    Percentage of the requests served within a certain time (ms)
      50%    161
      66%    174
      75%    182
Re:Go as an alternative to Node.js for Very Fast Servers by stock_toaster on Friday February 22, 2013 @02:38PM (#5266237)
wrk or weighttp are my preferred tools.
Re:Go as an alternative to Node.js for Very Fast Servers by kintamanimatt on Saturday February 23, 2013 @12:58AM (#5268731)
I did this test a while ago on my laptop running Linux Mint. With higher concurrency levels (IIRC, about 1k simultaneous connections), I saw just the opposite, with cracks starting to show and Go performing worse than Node, although the V8 engine did consume more memory.
Re:Go as an alternative to Node.js for Very Fast Servers by zemo on Friday February 22, 2013 @02:14PM (#5266077)
check the memory usage. When I did the comparison, the node server's memory climbed steadily up to about 50MB, while the Go server's memory stabilized at about 17MB.
Re:Go as an alternative to Node.js for Very Fast Servers by davidw on Friday February 22, 2013 @03:23PM (#5266538)
It'd be interesting to throw Erlang into the mix, too.
Re:Go as an alternative to Node.js for Very Fast Servers by rdtsc on Saturday February 23, 2013 @03:04AM (#5268949)
One example:

http://eric.themoritzfamily.com/websocket-demo-results-v2.ht...

Has Node.js, Erlang, Scala, go and a lot of Python. On EC2 Erlang and Java pretty much blow everything else out of the water.

Re:Go as an alternative to Node.js for Very Fast Servers by yaix on Friday February 22, 2013 @02:58PM (#5266374)
In the comments of the article are some test results too, only that on that test, nodejs was slightly faster.
Re:Go as an alternative to Node.js for Very Fast Servers by tferris on Saturday February 23, 2013 @03:28AM (#5269004)
fyi, in the replies of the original post someone got totally different results. with v0.6 it was significantly faster than Go and with 0.8 was on the same level
Re:Go as an alternative to Node.js for Very Fast Servers by weix on Friday February 22, 2013 @02:31PM (#5266209)
r u using x86 go? or x64 go?
Re:Go as an alternative to Node.js for Very Fast Servers by jlgreco on Friday February 22, 2013 @02:58PM (#5266373)
Unless he went out of his way to use x86, I can't imagine he's not using x86-64. x86-64 has traditionally been the arch that Go has gotten the most attention on anyway, it is what everyone uses these days.