apache+varnish slower than apache alone?
I want to speed up web-server (I have to use apache) running on my VPS, so I installed varnish. I did not play much with configuration, just moved apache to 8080-port (using mpm_prefork, in default 5/5/10/150/0 configuration) and varnish to 80-port.
I used "curl" to check if requests are routed properly (index.html is the default "welcome" one on debian, ~10kB static file):
curl -I http://127.0.0.1/index.html (there is X-Varnish header, so its goes over varnish)
curl -I http://127.0.0.1:8080/index.html (this goes directly to apache)
Now I'm doing some benchmarks, but to my surprise I get slightly better results for pure apache, than for apache+varnish:
ab -c 50 -n 100000 http://127.0.0.1/index.html (~2300 req/sec)
ab -c 50 -n 100000 http://127.0.0.1:8080/index.html (~2500 req/sec)
How is this possible? I expected varnish would speed web up by at least factor 2, especially for static cacheable files...