0

I am trying to increase the performance of my lighttpd system by using SMP workers for multiple cores.It turns out that instead of improving the performance it is degrading it. I dont seem to understand why this is the case.

The documentation CLAIMS that it should scale linearly with the number of cores/processors when roughly twice the number of SMP workers are configured as the number of cores. I did the testing for core:worker ratios of 1:1 and 1:2.

I am benchmarking this with ab. My setup has 4 virtual cores.

Here are the test results done with a small document size

ab -n 10000 -c 50  http://localhost/index.html

1. Default(no smp workers)
   Requests per second:    3581.99 [#/sec] (mean)
   Time per request:       13.959 [ms] (mean)
   Time per request:       0.279 [ms] (mean, across all concurrent requests)
   Transfer rate:          1518.15 [Kbytes/sec] received

2. 8 SMP workers
   Requests per second:    2292.12 [#/sec] (mean)
   Time per request:       21.814 [ms] (mean)
   Time per request:       0.436 [ms] (mean, across all concurrent requests)
   Transfer rate:          971.46 [Kbytes/sec] received

3. 4 SMP workers
   Requests per second:    2510.13 [#/sec] (mean)
   Time per request:       19.919 [ms] (mean)
   Time per request:       0.398 [ms] (mean, across all concurrent requests)
   Transfer rate:          1063.86 [Kbytes/sec] received

These results make to sense to me. The results are easily repeatable also on any other machine. Infact as the machine becomes more powerful the degrading effect becomes more prominent. Any explanation?

auny
  • 101

1 Answers1

0

If you've got 4 cores then why are you testing with 8 threads? I'd have gone with 2,3,4 & 5

You are running ab on the same machine as the webserver. Did you fence the processors between ab and lighttpd? If not then they will be competing for CPU, if your load is geting too high then the webserver processes will be getting kicked out of the CPU prematurely.

Try running ab from seperate hardware.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • I ran the generator (ab) and this time weighttpd from different hardware this time. This time there was no degradation but the numbers stayed constant with and without SMP. I used weighttpd so utilize all cores on the generator machine – auny Jun 13 '13 at 13:19