Skip to content

Benchmark for RPS performance of Node.js and C++ web servers with Apache Benchmark (ab) for 10K requests without concurrency.

Notifications You must be signed in to change notification settings

spanarin/node-vs-c-plus-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

No concurrency test for "Hello, world!" web servers - 10K requests

Summary

C++ web server is 5.4x faster:

  • C++: 20.5K rps
  • Node: 3.8K rps

Test: 10000 requests, no concurrency, iMac M3 (Apple Silicon).

C++ server

ab -n 10000 -c 1 http://127.0.0.1:8888/

Results

This is ApacheBench, Version 2.3 <$Revision: 1913912 $>
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)
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:        127.0.0.1
Server Port:            8888

Document Path:          /
Document Length:        13 bytes

Concurrency Level:      10
Time taken for tests:   0.489 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      970000 bytes
HTML transferred:       130000 bytes
Requests per second:    20463.12 [#/sec] (mean)
Time per request:       0.489 [ms] (mean)
Time per request:       0.049 [ms] (mean, across all concurrent requests)
Transfer rate:          1938.40 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     0    0   0.9      0      27
Waiting:        0    0   0.9      0      27
Total:          0    0   0.9      0      28

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

Node server

ab -n 10000 -c 1 http://127.0.0.1:3300/

Results

This is ApacheBench, Version 2.3 <$Revision: 1913912 $>
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)
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:        127.0.0.1
Server Port:            3300

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      1
Time taken for tests:   2.615 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      2100000 bytes
HTML transferred:       110000 bytes
Requests per second:    3824.74 [#/sec] (mean)
Time per request:       0.261 [ms] (mean)
Time per request:       0.261 [ms] (mean, across all concurrent requests)
Transfer rate:          784.37 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     0    0   0.4      0      25
Waiting:        0    0   0.3      0      23
Total:          0    0   0.4      0      25

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

About

Benchmark for RPS performance of Node.js and C++ web servers with Apache Benchmark (ab) for 10K requests without concurrency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published