Installing Varnish, Nginx, Apache, APC, & Wordpress On A Single Server, Good or Bad?
-
SERVER SPECS: Linux Server (CentOS), Intel Xeon 3470 Quad Core (2.93GHz x 4) processor, 4 GB DDR3 Memory, 1TB Hard Disk Space, 10 TB Bandwidth and 9 Dedicated IPs. AIM: To speed up my wordpress blog + Increase server's capacity to handle heavy load PLAN: This is how I am planning to setup my server - - VARNISH (in the front, to cache server responses) >> NGINX (to effectively handle static content & overcome the C10k problem) >> APACHE (behind Nginx, to effectively deliver dynamic content) >> APC (PHP page, database & object caching) >> CPANEL (which requires Apache, and I require it) >> WORDPRESS >> W3 TOTAL CACHE (caching plugin for Wordpress). Will this kind of a setup make my server more load capable and speed up my blog?
-
Answer:
As a rule, unless you're receiving very little traffic, you shouldn't put a web server in the same box with a database server. Both will compete for resources. I have also used Varnish in the same box with Apache and Nginx for some time and noticed that Varnish' hit rates were not as good as they should. After moving Varnish to its own box the hit rates increased dramatically.
Alexis Bellido at Quora Visit the source
Other answers
Um, that is a huge box for a wordpress site. Even for a really big wordpress site. So short answer, yes. It is enough. Skip Varnish. Use Nginx for static assets. Use Nginx caching (http://wiki.nginx.org/ReverseProxyCachingExample) nginx caching uses a similar technique to varnish. You probably won't notice the performance difference. You will notice the difference with figuring out the best cache times, best cache expiry, etc. Try setting your cache times to 1 second. It will mean your server will only need to handle 1 req/sec as most HTTP GET will be from the cache. Nginx is really smart, when the cache is invalidated it can serve the stale data while the cache is being updated from Wordpress/PHP. Skip Apache. Use PHP-FPM, have nginx talk to it via a unix socket. You save yourself the RAM of apache. You save yourself the TCP/IP over head (yes ther still is some when talking to localhost) of proxying to localhost. (http://wiki.nginx.org/PHPFcgiExample#Using_a_Unix_Socket) Database, do you have more than 2GBs of blog posts? If not, it doesn't really matter if it is on the same box. Assuming Wordpress + MySQL, you can even have PHP connect to a mysql's unix socket. Again saving the TCP overhead. Done. Go serve 2000+/req/sec now. :) Edit Oh i missed the cpanel require. But a quick google revealed: http://www.prohost.be/blog/centos/installing-php-fpm-for-cpanel/
Benson Wong
To add on top of what mentioned above (very good advice and highly recommended), I don't think you even need apache since you have nginx in the game. Apache consumes a lot of ram and resources in general where nginx treats them with "respect". So using nginx as your main server is recommended since with the same resources it can do more for you. If you want to read more about nginx, a good explanation is given by at . By using the setup Varnish-> Nginx (apc, php-fpm) and memcached (since it's a distributed cache and same cache can be used by many servers e.g. db server and varnish) you should be more than fine.
Mano Carayannis
Now sure how much traffic you are planning for. But if you could increase RAM to 8GB, which is pretty cheap now-a-days. And I dont see any point of using so many things. Varnish is not necessary, if its only for WordPress, NGiNX could handle it alone, and I think memcached over FastCGI with PHP+FPM works better. Even if you could configure from server end W3TC is really not necessary. But for most guys W3TC is just easy.
M Asif Rahman
How about trying G-WAN? It performs much better than nginx or any other existing webserver. Possibly use HipHop to translate Php to C++. You will instantly see the difference. One of the stronger points G-WAN being theĀ Key-Value Store which inserts 100 million keys per second Though nginx integration isnt supported directly on cpanel, you can resort to a plugin, http://nginxcp.%C3%82%C2%A0%20Do keep in mind, nginx doesn't support .htaccess at account level, htaccess based caching rules for the w3 TC plugin may have to be defined independently.
Subhadip Mitra
Related Q & A:
- How do I redirect all posts from the old Wordpress to a subdomain?Best solution by en.support.wordpress.com
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- Is coffee good or bad for you?Best solution by Yahoo! Answers
- Getting a loan from Sallie Mae Good or Bad?Best solution by answers.yahoo.com
- What are some good examples for good and bad peer pressure?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.