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, {
       target : 'http://127.0.0.1:19007'
   });
});

server.listen(19081);


if i test my server with:

ab -c 100 -n 10000 
http://foo:19081/data/_8d51df079d51bc090dc2307310b474fc_CONTENT

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):

ab -c 100 -n 10000 
http://foo:19007/data/_8d51df079d51bc090dc2307310b474fc_CONTENT

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

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/0c427804-eda3-4345-ad32-eb106080c5cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to