Dear all
i'm experiencing some performance-gap using http-proxy.
I've got a very simple server that does the following:
var http = require('http');
var httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
var server = http.createServer(function(req, res) {
proxy.web(req, res, {
});
});
server.listen(19081);
if i test my server with:
i have:
Requests per second: 553.79 [#/sec] (mean)
Time per request: 180.575 [ms] (mean)
Time per request: 1.806 [ms] (mean, across all concurrent requests)
Transfer rate: 36467.65 [Kbytes/sec] received
but if try to go directly to the port 19007 (served by apache):
i have:
Requests per second: 1713.75 [#/sec] (mean)
Time per request: 58.352 [ms] (mean)
Time per request: 0.584 [ms] (mean, across all concurrent requests)
Transfer rate: 112853.17 [Kbytes/sec] received
i've tried also to enable cluster and fork some more process in the nodejs script but i'm not able to take over ~700 req/sec.
Can you help me to figure it out ?
- is a problem of implementation of my simple proxy ?
- is a "normal" gap ?
- maybe http-proxy has too many features and in this scenario i need something lighter and faster ?
Thanks to all in advance