Le jeudi 28 octobre 2010 15:58:55, Ariel a écrit :
> Hi Cyril,
> My test wasn't designed to look at higher load averages (many users at
> once) since the problem I was looking at was just increased latency for
> all requests.
You mean that with only 1 request at a time through haproxy you obtain a
response in 150ms where a direct request gives a response in 10 to 30ms ?
I agree, this looks really strange.
I reproduced nearly the same environment as you described and could not
reproduce this latency (only 1 nginx instance in my case).
To be clear on the config I used (I didn't took time to have a clean and tuned
installation):
- 1 server running VirtualBox 3.2.8
OS : Mandriva Cooker (not recently updated)
Kernel : Linux localhost 2.6.35.6-server-1mnb #1 SMP ... x86_64 GNU/Linux
CPU : Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz
Memory : 4Gb
IP : 192.168.0.128
With 2 small VMs based on a Debian Lenny 5.0.6 :
Kernel : 2.6.26-2-amd64 #1 SMP ... x86_64 GNU/Linux
- Instance 1 :
1 CPU allocated
Memory : 512Mb
IP : 192.168.0.23
HAProxy 1.4.8 installed with your configuration (only one backend server
pointing to the second VM instance)
- Instance 2 :
1 CPU allocated
Memory : 384Mb
IP : 192.168.0.24
nginx 0.7.65 embedding your ajax test
- 1 laptop used as the client
OS : Ubuntu 10.10
Kernel : 2.6.35-22-generic #35-Ubuntu SMP ... i686 GNU/Linux
Memory : 2Gb
TEST 1 : Firefox/Firebug
- direct access to nginx via 192.168.0.24 : firebug shows response times about
2ms
- access to haproxy via 192.168.0.23 : response times are about 3ms
TEST 2 : Chromium/Firebug lite
- direct access to nginx via 192.168.0.24 : response times between 10 and 15ms
- access to haproxy via 192.168.0.23 : response times still between 10 and
15ms
TEST 3 : using ab for 10000 requests with a concurrency of 1 (no keepalive)
- via nginx : ab -n10000 -c1 http://192.168.0.24/ajax.txt
Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 2
95% 2
98% 2
99% 3
100% 16 (longest request)
- via haproxy : ab -n10000 -c1 http://192.168.0.23/ajax.txt
Percentage of the requests served within a certain time (ms)
50% 3
66% 3
75% 4
80% 4
90% 4
95% 4
98% 5
99% 5
100% 14 (longest request)
The results are similar.
TEST 4 : using ab for 10000 requests with a concurrency of 10 (no keepalive)
- via nginx : ab -n10000 -c10 http://192.168.0.24/ajax.txt
Percentage of the requests served within a certain time (ms)
50% 6
66% 6
75% 6
80% 6
90% 7
95% 8
98% 8
99% 9
100% 25 (longest request)
- via haproxy : ab -n10000 -c10 http://192.168.0.23/ajax.txt
Percentage of the requests served within a certain time (ms)
50% 18
66% 21
75% 23
80% 24
90% 30
95% 35
98% 40
99% 43
100% 56 (longest request)
Ok, it starts to be less responsive but this is because the VirtualBox server
now uses nearly 100% of its 2 CPU cores.
But this is still far from what you observe.
TEST 5 : using ab for 10000 requests with a concurrency of 100 (no keepalive)
Just to be quite agressive with the VMs.
- via nginx : ab -n10000 -c100 http://192.168.0.24/ajax.txt
Percentage of the requests served within a certain time (ms)
50% 54
66% 55
75% 57
80% 65
90% 76
95% 78
98% 79
99% 81
100% 268 (longest request)
- via haproxy : ab -n10000 -c100 http://192.168.0.23/ajax.txt
Percentage of the requests served within a certain time (ms)
Percentage of the requests served within a certain time (ms)
50% 171
66% 184
75% 192
80% 198
90% 217
95% 241
98% 287
99% 314
100% 3153 (longest request)
I can't help you much more but I hope this results will give you some points
of comparison. What is the hardware of your Virtualbox server ?
--
Cyril Bonté