简体   繁体   English

Nginx FastCGI缓存VS Varnish?

[英]Nginx FastCGI cache VS Varnish?

I'm currently developing a high-performance, high-load web application. 我目前正在开发一个高性能,高负载的Web应用程序。

I'm currently running nginx with FastCGI for PHP-FPM, APC (opcode cache) but also it's new feature; 我目前正在使用FastCGI运行nginx,用于PHP-FPM,APC(操作码缓存),但它也是新功能; FastCGI cache. FastCGI缓存。 FastCGI cache allows me to cache dynamic content (like php pages) which speeds up the application tremendously. FastCGI缓存允许我缓存动态内容(如php页面),这极大地加速了应用程序。

I have a question tho. 我有一个问题。 Should I stick with the FastCGI cache, or is Varnish "better" (faster)? 我应该坚持使用FastCGI缓存,还是Varnish“更好”(更快)? 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. 到目前为止,我对FastCGI非常满意,但我已经在网上阅读了数千篇文章,说Varnish很好。

However, according to this benchmark/article , Varnish seems to be a bad choice for many concurrent users. 但是, 根据这个基准/文章 ,对于许多并发用户来说,Varnish似乎是一个糟糕的选择。 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. 由于FastCGI缓存很新,我很难找到它和Varnish的基准测试。

I would not totally believe the tests performed in Apache Bench . 我不完全相信在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. Varnish也不错,您应该知道如何正确配置它。 Its better to look how Varnish and Nginx handles/purges the cache. 最好看看Varnish and Nginx如何处理/清除缓存。 However, I believe Nginx Microcache is super-fast. 但是,我相信Nginx Microcache非常快。 But again, your Hardware and OS also plays vital role. 但同样,您的Hardware and OS也起着至关重要的作用。

No problem with making simple tests with AB. 使用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. 但是varnish配置缺少任何影响性能和线程的守护进程设置 - 所以不可能说你是否可以从链接的基准测试中说出任何内容。

I'm running varnish with 15k req/s peaks on an average machine. 我在平均机器上运行15k req / s峰值的清漆。 Benchmarks before it was taken into use showed very low load at 50k req/s. 在投入使用之前的基准测试表明,在50k req / s时负载非常低。 If you land at 8k you have done something seriously wrong (or maybe also if you did nothing) in your configuration. 如果你降落在8k,那么你的配置中就会出现严重错误(或者如果你什么都不做的话)。

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. 如果你谷歌有点为清漆配置,你也会看到许多有经验的人正在谈论处理2-300k req / s。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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