In this article, we have explained why Varnish is not needed for Nginx on Rackspace Cloud Server specially for WordPress. Nginx is underestimated. A person with Infrastructure Managed Level was asking (while fighting) on Rackspace Community to solve problem with Varnish. His setup apparently is/was three servers – one application server, one web server (which he referred as master node) and a cache server in front running Varnish. The website is powered by WordPress and as expected – he was facing errors.
Why Varnish is Not Needed for Nginx on Rackspace Cloud : Understand The High-end Hardware Philosophy
Rackspace apparently uses good quality, well maintained hardware with great networking for their Cloud Infrastructure. We are using one level down to Software Defined Data Center. While Vyatta Network OS and Vyatta Network Appliance is available on Rackspace, unfortunately it is not exactly what we want – a dedicated and isolated networking at hardware level.
To scale horizontally means to scale out, that simply means to add more nodes to a system behind a load balancer. Another way to scale is vertically or scale up, which means to add resources to a single node. Rackspacce has a different service to auto scale, we practically do not need to think about the second option in manual way.
If one do not understand the needed infrastructure with Infrastructure Managed Level, should ask Rackspace employee to comment or advice against a setup. It can happen that, with other more intensely managed plan, cost will go down.
Directly coming to the topic of Varnish and Nginx. Yes, we write about Varnish Cache too. But, new users possibly should avoid Varnish for various reasons which we will tell you in the next paragraph.
Why Varnish is Not Needed for Nginx on Rackspace Cloud
One 1 GB PVHVM server will cost at minimum 23 USD / month for RAW infrastructure. From our tests, using Varnish with W3TC Plugin gives 4% faster result than a hugely tweaked Nginx. Varnish works great in front of Apache2 web server. Nginx with PHP5-FPM has lot of ways to deliver the pages Asynchronously like with LuaJit. Even if you do not know Lua, optimizing Nginx to serve static files, forcing PHP-FPM Microcache, will give a constant result.
Varnish has powerful vcl configuration, purge, reverse proxy cache, ESI nginx can work with FCGI; but the total cost of ownership per year for a separate server plus huge effort to configure plus the risks of getting odd errors like 502 error, Guru Meditation Error are too high to be managed by one person in Infrastructure Managed Level. We can simply scale up using Auto Scale or spin up a web server with huge RAM to handle the traffic for just an emergency. Also, there is Object Cache. These days, there is nothing spinning in the server’s hard disk. As Apache2 can behave oddly with increasing load, we add Varnish to polish the fronted. For Nginx, it increases complexity. Additionally, a poor malloc implementation may add unnecessary contention.
Honestly, if Varnish is required for 365 days; you need to upgrade your hardware infrastructure or find flaw in software infrastructure. For so much high traffic site, your need is possibly DevOps Automation Service from Rackspace.