September 18, 2013

Node.js and Benchmarking it on Mac

I'm looking through node.js which is a webserver with javascript code. So one of the cool features is that all of its commands are non-blocking! the server just keeps running. There is no mutex or multi-thread locks or deadlocks etc.

If you test it with ab command which is apache benchmark for webservers. ab already ships in Mac


$ ab -n 100 -c 100 http://127.0.0.1:8000/         # create 100 connections , 100 of which are simultaneous
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 127.0.0.1 (be patient).....done


Server Software:       
Server Hostname:        127.0.0.1
Server Port:            8000

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      100
Time taken for tests:   2.029 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      11300 bytes
HTML transferred:       1200 bytes
Requests per second:    49.29 [#/sec] (mean)
Time per request:       2028.911 [ms] (mean)
Time per request:       20.289 [ms] (mean, across all concurrent requests)
Transfer rate:          5.44 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    3   1.3      3       5
Processing:  2009 2017   4.2   2018    2022
Waiting:        7   15   4.4     14      21
Total:       2014 2020   3.0   2022    2024

Percentage of the requests served within a certain time (ms)
  50%   2022
  66%   2022
  75%   2022
  80%   2022
  90%   2022
  95%   2024
  98%   2024
  99%   2024
 100%   2024 (longest request)

No comments:

Post a Comment