6

I'm currently developing a high-performance, high-load web application.

I'm currently running nginx with FastCGI for PHP-FPM, APC (opcode cache) but also it's new feature; FastCGI cache. FastCGI cache allows me to cache dynamic content (like php pages) which speeds up the application tremendously.

I have a question tho. Should I stick with the FastCGI cache, or is Varnish "better" (faster)? I'm only looking for pure performance, in terms of speed and concurrency. So far I'm very pleased with FastCGI, but I've read thousands of articles on the 'net, saying Varnish is good.

However, according to this benchmark/article, Varnish seems to be a bad choice for many concurrent users. Is that really the case?

I'm curious in your previous experiences in this area, please share your thoughts! Since the FastCGI cache is pretty new, I'm having a hard time finding benchmarks with it and Varnish.

Eric
  • 18,532
  • 2
  • 34
  • 39

2 Answers2

2

I would not totally believe the tests performed in Apache Bench. Its different scenario in real-time high load compared to requesting single page for many times. Varnish is not bad, you should know how to configure it properly. Its better to look how Varnish and Nginx handles/purges the cache. However, I believe Nginx Microcache is super-fast. But again, your Hardware and OS also plays vital role.

  • Microcache is basicly caching the site for ~1s, which I can easily adjust in my config. I have also the cache-purge-module for FastCGI, which allows me to very very easy purge the cache by just a HTTP-request. I might have to do some benchmarking myself to see some numbers and concurrency stability. Thanks for answering btw! – Eric Mar 25 '13 at 20:59
  • thats the spirit, the name of the game is `Don't trust other benchmark blogs` most of them are shit, or they really don't know how to tune, they just do `ab -n` and all... Better use jMeter, it gives bit realistic result. not to forget is that `Varnish` supports dynamic caching too. –  Mar 25 '13 at 21:07
1

No problem with making simple tests with AB. But the varnish config lacks any daemon settings that affect performance and threading - so it's impossible to say if you can say anything from the linked benchmark.

I'm running varnish with 15k req/s peaks on an average machine. Benchmarks before it was taken into use showed very low load at 50k req/s. If you land at 8k you have done something seriously wrong (or maybe also if you did nothing) in your configuration.

If you Google a bit for varnish configuration you will also see that many of those with experience are talking about handling 2-300k req/s.

Clarence
  • 2,944
  • 18
  • 16
  • _"varnish config lacks any daemon settings that affect performance and threading"_ - but nginx config has used only 1 worker process, so that was fair. _"those with experience are talking about handling 2-300k req/s"_ - not a big deal, since [nginx is able to handle 1M req/s](http://lowlatencyweb.wordpress.com/2012/03/26/500000-requestssec-piffle-1000000-is-better/). – VBart Apr 15 '13 at 17:42