Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to measure perfornace on nginx with ab. Doing the same ab from the local machine gives me about 10 times the requests per second as from a remote machine that is located on the same network.

Local results:
Server Software:        nginx
Server Hostname:        192.168.0.116
Server Port:            8000

Document Path:          /data/adpix/picture/test.jpg
Document Length:        4602 bytes

Concurrency Level:      1000
Time taken for tests:   1.475 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      49854651 bytes
HTML transferred:       46622862 bytes
Requests per second:    6778.38 [#/sec] (mean)
Time per request:       147.528 [ms] (mean)
Time per request:       0.148 [ms] (mean, across all concurrent requests)
Transfer rate:          33001.34 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       25   67  24.4     66     137
Processing:    28   73  24.9     71     146
Waiting:       13   42  19.7     40     110
Total:         75  140  17.9    139     182

And now from a remote machine:

Server Software:        nginx
Server Hostname:        192.168.0.116
Server Port:            80

Document Path:          /data/adpix/picture/test.jpg
Document Length:        4602 bytes

Concurrency Level:      1000
Time taken for tests:   14.422 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      51737663 bytes
HTML transferred:       48380826 bytes
Requests per second:    693.40 [#/sec] (mean)
Time per request:       1442.165 [ms] (mean)
Time per request:       1.442 [ms] (mean, across all concurrent requests)
Transfer rate:          3503.42 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       68  230 182.7    166    3052
Processing:   110 1113 2918.5    227   11862
Waiting:       20  648 2101.1    189   11451
Total:        246 1344 2898.0    387   11981

The problem seems to be within the connection times.

Network ist fast. Netperf returns 80 Mb/s Both machines are VM hosted on 2 different physical machines running quad cores. connected via gigabit switch.

Has anybody an idea what could be the problem?

Thank you for any help.

share|improve this question
    
Next time please post the exact command used to run the test. Did you used the -k (keep-alive) switch? Opening and closing a network connection for each request takes a lot of time. Look here form something similar. –  user112727 Mar 3 '12 at 0:13
add comment

1 Answer 1

up vote 1 down vote accepted

It seems perfectly normal, just due to packet switching times and the speed of light in fiber. What makes you think 1.442ms is "slow"?

share|improve this answer
    
The amount of requests/s is just about 693 while ffrom the same machine I get 10 times the amount. I would like to benchmark nginx against apache and with this kind of test setup I get no differences. –  merlin Feb 21 '12 at 3:31
1  
You're going to have to get the machine under load to see a difference. You're testing without the machine even breaking a sweat, so all you're seeing is the network latency. –  David Schwartz Feb 21 '12 at 4:01
    
So how do I manage to find out how many requests / s the webserver can handle? If I test with ab from the same machine, then I will put aditional cpu load on the same server where nginx is running on. –  merlin Feb 21 '12 at 10:13
    
It depends what you really want to measure. For example, does it matter if the web server can handle more requests than the network can feed it? (And, of course, how could you measure?) –  David Schwartz Feb 21 '12 at 10:17
1  
Then so long as the cost of ab is constant across tests (which it should be) you should be able to run the test locally. Note that tuning for best performance in this test may or may not optimize real-world performance over the network. –  David Schwartz Feb 21 '12 at 15:57
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.