简体   繁体   中英

Nginx FastCGI cache VS Varnish?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM