Last active
April 11, 2019 09:44
-
-
Save Unitech/4be07d1dd815afce793b6ab60949c167 to your computer and use it in GitHub Desktop.
Benchmark PM2 vs HAPROXY vs NGINX - Simple HTTP Node.js application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 61 | |
model name : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz | |
stepping : 4 | |
microcode : 0x23 | |
cpu MHz : 2457.468 | |
cache size : 3072 KB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> wrk -c 100 http://localhost:6001 | |
Running 10s test @ http://localhost:6001 | |
2 threads and 100 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 4.43ms 4.50ms 56.72ms 86.00% | |
Req/Sec 14.50k 2.31k 18.41k 89.50% | |
288589 requests in 10.01s, 34.40MB read | |
Requests/sec: 28837.34 | |
Transfer/sec: 3.44MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 20000 | |
frontend http-frontend | |
mode tcp | |
bind *:6001 | |
default_backend http-backend | |
backend http-backend | |
mode tcp | |
balance roundrobin | |
server http-instance-0 localhost:8001 maxconn 20000 | |
server http-instance-1 localhost:8002 maxconn 20000 | |
server http-instance-2 localhost:8003 maxconn 20000 | |
server http-instance-3 localhost:8004 maxconn 20000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var server = http.createServer(function(req, res) { | |
res.writeHead(200); | |
res.end('hey'); | |
}).listen(8000, function() { | |
console.log('Listening on %s', server.address().port); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> wrk -c 100 http://localhost:7001 | |
Running 10s test @ http://localhost:7001 | |
2 threads and 100 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 3.94ms 2.55ms 44.78ms 93.74% | |
Req/Sec 13.61k 1.57k 16.67k 90.00% | |
270752 requests in 10.02s, 32.28MB read | |
Requests/sec: 27011.39 | |
Transfer/sec: 3.22MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 5; ## Default: 1 | |
daemon off; | |
events { | |
worker_connections 4096; ## Default: 1024 | |
} | |
stream { | |
server { | |
listen 7001; | |
proxy_pass apistream; | |
} | |
upstream apistream { | |
server 127.0.0.1:8001; | |
server 127.0.0.1:8002; | |
server 127.0.0.1:8003; | |
server 127.0.0.1:8004; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> wrk -c 100 http://localhost:8001 | |
Running 10s test @ http://localhost:8001 | |
2 threads and 100 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 3.62ms 7.83ms 225.85ms 97.73% | |
Req/Sec 17.79k 2.80k 21.40k 85.50% | |
354083 requests in 10.01s, 42.21MB read | |
Requests/sec: 35387.79 | |
Transfer/sec: 4.22MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shouldn't this value changed based on certain parameters? (env variable, etc.)