lighttpd: SMP workers causing performance degrade – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.
But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, web-server, lighttpd, benchmark, ab.
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
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?
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.