You've got yourself an old version of ab (this is an ab bug) - you'll need 
to upgrade.

Try: 
http://adventuresincoding.com/2012/05/how-to-get-apachebenchab-to-work-on-mac-os-x-lion
(assuming you have a Mac since this seems to be a Mac bug)

And then: ab -s 300 -n 100000 -c 100 http://127.0.0.1/

Works On My Machine (tm):

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
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)


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            80

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      100
Time taken for tests:   506.056 seconds
Complete requests:      100000
Failed requests:        0
Total transferred:      8600000 bytes
HTML transferred:       1100000 bytes
Requests per second:    197.61 [#/sec] (mean)
Time per request:       506.056 [ms] (mean)
Time per request:       5.061 [ms] (mean, across all concurrent requests)
Transfer rate:          16.60 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  391 3677.4      0   35092
Processing:     1   86  22.5     89     161
Waiting:        1   86  22.5     88     160
Total:          1  476 3674.6     89   35212

Percentage of the requests served within a certain time (ms)
  50%     89
  66%     96
  75%     98
  80%    100
  90%    106
  95%    117
  98%    129
  99%  35011
 100%  35212 (longest request)

... using your code and setup with terminals.

Richard





On Thursday, January 9, 2014 4:28:18 PM UTC, Elaidon wrote:
>
> Hi all,
>
> I am new to node.js and to start I am doing some tests.
> In particular I am trying to open 4 sessions of a simple server on ports: 
> 8001, 8002, 8003, and 8004.
> The only task of the simple server is to write "hello world".
> Moreover I have a script based on node-http-proxy to load balance the 
> requests to the opened sessions.
>
> This is the code of simpleServer.js:
>
> var http = require("http");
> var port = process.argv[2];
>
> http.createServer(function(request, response) {
>   response.writeHead(200);
>   response.end("Hello world");
> }).listen(port);
>
>
>
> And this is the code of the load balancer nodeHttpProxy.js
>
> var httpProxy = require('http-proxy');
> //
> // A simple round-robin load balancing strategy.
> // 
> // First, list the servers you want to use in your rotation.
> //
> var addresses = [
>   {
>     host: 'localhost',
>     port: 8001
>   },
>   {
>     host: 'localhost',
>     port: 8002
>   },
>   {
>     host: 'localhost',
>     port: 8003
>   },
>   {
>     host: 'localhost',
>     port: 8004
>   }
> ];
>
> httpProxy.createServer(function (req, res, proxy) {
>   //
>   // On each request, get the first location from the list...
>   //
>   var target = addresses.shift();
>
>   //
>   // ...then proxy to the server whose 'turn' it is...
>   //
>   // console.log('balancing request to: ', target);
>   proxy.proxyRequest(req, res, target);
>
>   //
>   // ...and then the server you just used becomes the last item in the 
> list.
>   //
>   addresses.push(target);
> }).listen(80);
>
>
>
>
> For testing, I open a terminal and launch four sessions of simpleServer,js 
> for each port and then I run httpNodeProxy.js.
> Finally I launch the command:
>
> ab -n 100000 -c 100 http://127.0.0.1/
>
>
>
> and this is the result:
>
> This is ApacheBench, Version 2.3 <$Revision: 655654 $>
> 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 10000 requests
> Completed 20000 requests
> Completed 30000 requests
> apr_poll: The timeout specified has expired (70007)
> Total of 33235 requests completed
>
>
> Do anyone know why the test do in timeout?
>
> Is there any error in my scripts or any configurations limit in node.js or 
> my Linux CentOS 6.5 (vergin new installation) ?
>
>
> Thank you!
> Elaidon
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to