Skip to content
Blade Pan edited this page Feb 26, 2014 · 2 revisions

The experiments are conducted upon the commit 775f95a421a3c33c4d6040c671ca45d3efa81cf1

Numbers talk! Go beats NodeJs in this test. The test is using ab to download a 101k file using 100 concurrency level. Here is the summery. Nodejs with 1 worker is way slower than GO. Go used 4 or 5 threads during the test, so I added a 4 workers nodejs test case even the test bed has only 2 cores. GO 3236.19 per sec (mean) nodejs (single process) 900.58 per sec (mean) nodejs (2 workers) 1656.90 per sec (mean) nodejs (4 workers) 1378.54 per sec (mean) nodejs (5 workers) 1288.57 per sec (mean)

Detail

GO

/usr/local/apache2/bin/ab -c 100 -n 20000 http://localhost:8964/101k.html

Concurrency Level: 100 Time taken for tests: 6.180 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2072240000 bytes HTML transferred: 2068480000 bytes Requests per second: 3236.19 [#/sec] (mean) Time per request: 30.901 [ms] (mean) Time per request: 0.309 [ms] (mean, across all concurrent requests) Transfer rate: 327449.59 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.3 0 4 Processing: 2 31 8.8 31 82 Waiting: 1 30 8.8 31 64 Total: 5 31 8.7 31 82

Percentage of the requests served within a certain time (ms) 50% 31 66% 36 75% 39 80% 40 90% 42 95% 43 98% 44 99% 44 100% 82 (longest request)

nodejs 2 workers

/usr/local/apache2/bin/ab -c 100 -n 20000 http://localhost:8964/101k.html

Server Software:
Server Hostname: localhost Server Port: 8964

Document Path: /101k.html Document Length: 103424 bytes

Concurrency Level: 100 Time taken for tests: 12.071 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2070560000 bytes HTML transferred: 2068480000 bytes Requests per second: 1656.90 [#/sec] (mean) Time per request: 60.354 [ms] (mean) Time per request: 0.604 [ms] (mean, across all concurrent requests) Transfer rate: 167515.51 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 4 Processing: 1 60 23.9 61 126 Waiting: 1 38 16.4 38 101 Total: 1 60 24.0 61 126

Percentage of the requests served within a certain time (ms) 50% 61 66% 71 75% 77 80% 80 90% 89 95% 98 98% 113 99% 119 100% 126 (longest request)

Concurrency Level: 100 Time taken for tests: 6.180 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2072240000 bytes HTML transferred: 2068480000 bytes Requests per second: 3236.19 [#/sec] (mean) Time per request: 30.901 [ms] (mean) Time per request: 0.309 [ms] (mean, across all concurrent requests) Transfer rate: 327449.59 [Kbytes/sec] received

nodejs with 4 workers

Server Software:
Server Hostname: localhost Server Port: 8964

Document Path: /101k.html Document Length: 103424 bytes

Concurrency Level: 100 Time taken for tests: 14.508 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2070560000 bytes HTML transferred: 2068480000 bytes Requests per second: 1378.54 [#/sec] (mean) Time per request: 72.540 [ms] (mean) Time per request: 0.725 [ms] (mean, across all concurrent requests) Transfer rate: 139372.75 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 6 Processing: 1 72 37.7 67 228 Waiting: 1 45 26.5 41 187 Total: 1 72 37.7 67 228

Percentage of the requests served within a certain time (ms) 50% 67 66% 83 75% 93 80% 102 90% 124 95% 143 98% 167 99% 186 100% 228 (longest request)

nodejs single process

Server Software:
Server Hostname: localhost Server Port: 8964

Document Path: /101k.html Document Length: 103424 bytes

Concurrency Level: 100 Time taken for tests: 22.208 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2070560000 bytes HTML transferred: 2068480000 bytes Requests per second: 900.58 [#/sec] (mean) Time per request: 111.040 [ms] (mean) Time per request: 1.110 [ms] (mean, across all concurrent requests) Transfer rate: 91049.59 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 4 Processing: 65 111 10.8 109 139 Waiting: 27 70 12.2 66 129 Total: 69 111 10.8 109 139

Percentage of the requests served within a certain time (ms) 50% 109 66% 110 75% 111 80% 118 90% 128 95% 134 98% 136 99% 137 100% 139 (longest request)

nodejs with 5 workers

Server Software:
Server Hostname: localhost Server Port: 8964

Document Path: /101k.html Document Length: 103424 bytes

Concurrency Level: 100 Time taken for tests: 15.521 seconds Complete requests: 20000 Failed requests: 0 Total transferred: 2070560000 bytes HTML transferred: 2068480000 bytes Requests per second: 1288.57 [#/sec] (mean) Time per request: 77.605 [ms] (mean) Time per request: 0.776 [ms] (mean, across all concurrent requests) Transfer rate: 130276.64 [Kbytes/sec] received

Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 4 Processing: 1 77 51.7 66 376 Waiting: 1 48 32.7 40 280 Total: 1 77 51.8 66 376

Percentage of the requests served within a certain time (ms) 50% 66 66% 83 75% 96 80% 108 90% 140 95% 175 98% 226 99% 294 100% 376 (longest request)

Clone this wiki locally