Hello h2non,
I'm trying to use rocky as a loadbalancer, before digging into using http middlewares for traffic replay.
I did a benchmark before going further with this code:
var rocky = require('rocky')
var proxy = rocky({ forwardHost:true })
proxy
.balance(['http://localhost:8001']);
proxy.routeAll();
proxy.listen(3000);
Then the test http application listening on port 8001:
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200);
res.end('hey');
}).listen(process.env.PORT || 8001, function() {
console.log('App listening on port 8001');
});
I did a benchmark with wrk. The first one without rocky and the second by hitting rocky for traffic balancing:
unitech@t450: ~/rocky-lb/wrk
>>> wrk -c 100 -t 100 -d 10 http://localhost:8001
Running 10s test @ http://localhost:8001
100 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.11ms 1.06ms 30.05ms 96.07%
Req/Sec 246.53 25.70 494.00 96.38%
246977 requests in 10.10s, 28.50MB read
Requests/sec: 24453.03
Transfer/sec: 2.82MB
unitech@t450: ~/rocky-lb/wrk
>>> wrk -c 100 -t 100 -d 10 http://localhost:3000
Running 10s test @ http://localhost:3000
100 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 66.87ms 13.40ms 179.84ms 77.24%
Req/Sec 15.03 5.13 30.00 98.57%
14997 requests in 10.10s, 1.87MB read
Requests/sec: 1484.76
Transfer/sec: 189.95KB
The result is quite different with and without rocky.
Without rocky (builting node http server) I get 246000 requests processed in 10 seconds. By using rocky It goes to 14997 requests in 10 seconds, 16x less performant than the raw http server.
Do you have any tips on enhancing overall performance?
Aside from performance, rocky is clearly robust!
Thanks
Hello h2non,
I'm trying to use rocky as a loadbalancer, before digging into using http middlewares for traffic replay.
I did a benchmark before going further with this code:
Then the test http application listening on port 8001:
I did a benchmark with wrk. The first one without rocky and the second by hitting rocky for traffic balancing:
The result is quite different with and without rocky.
Without rocky (builting node http server) I get 246000 requests processed in 10 seconds. By using rocky It goes to 14997 requests in 10 seconds, 16x less performant than the raw http server.
Do you have any tips on enhancing overall performance?
Aside from performance, rocky is clearly robust!
Thanks