Scaling WordPress for High Traffic Enterprise Sites
WordPress is undoubtedly one of the most popular CMS we can find out there. It is easy to use, free and allows us to create websites of all kinds, from simple blogs to online stores. Everything will go great until our traffic starts to grow a lot. That’s when the problems arise. That’s why we are going to tell you how we can scale WordPress Hosting with high traffic while your blog grows.
As your WordPress site begins to grow, the CPU and RAM consumption by it also grows. Sometimes, it reaches the level that it is necessary to start making serious improvements both at the site level itself (programming / development) and as of the server.
Scaling High Traffic WordPress with up to 100.000 visits/day
At the server level, a very effective solution for high traffic WordPress is to deploy the services through several servers that will be dedicated to running a service exclusively each. In this case, the most basic recommended configuration is to use a server for the web server. Another way is to dispatch PHP and also dispatch the databases.
The services that we run in each one are also keys to performance. It is because the performance provided by an Apache + MySQL database serverfor example, is lower than that obtained through Nginx + PHP-FPM + MySQL / MariaDB. In fact, this last type of configuration is the one that we most recommend to our high traffic customers WordPress.
To get an idea, the server structure would look like this:
- Server 1: Nginx
- Server 2: PHP-FPM
- Server 3: MariaDB / MySQL (performance difference is minimal)
This way, we will have the first server exclusively to dispatch all the static content of the dynamic + site through PHP-FPM. The second will put it to process all PHP requests and finally the third one for the databases.
Through this method, we will be distributing the tasks on three servers instead of just one, which will lead to better performance at the server level. Therefore, it will allow more resources to be available for our website.
Additionally, it is also possible to place a Memcached installation on the same server that we run MySQL. Therefore, we can use the service to cache part of our site at the level of heavy and static SQL queries, thus improving the performance of SQL operations.
But that’s not all! You can also make use of a CDN that would be responsible for distributing the static content of our site more quickly. It helps your web hosting services to alleviate even more the load on server 1 and providing better performance. The best options as we always recommend are CloudFlare and MaxCDN.
Anyway, the solution that we mentioned above is perfect for WordPress sites with approximately 100,000 visits a day.
Scaling High Traffic WordPress with more than 100.000 visits/day
Even so, it is possible to take things a little more to the extreme if we have WordPress Blog that receives a greater number of visits. We can opt for a configuration of up to 4 servers with the following structure:
- Server 1: Dynamic Nginx
- Server 2: Static Nginx
- Server 3: PHP-FPM
- Server 4: MariaDB / MySQL
The main difference between this configuration and the previous one is that Nginx dispatches dynamic requests through PHP-FPM from a single server. We also highlight that in this server scheme, we will not use CDN, instead we will place a new server 2 that will handle distribute all the static content of our site, which in some cases we have seen that results in better data transfer savings if you use a CDN like MaxCDN.
But we are not going to stop now, because for sites that have even more visits, it is possible to configure a larger number of servers in a balanced way. That’s right, we can place several servers to distribute the static and dynamic content through Nginx, another for PHP-FPM and even others for the databases in cluster or replication mode, that way we will have multiple servers in charge of dispatching our site.
Of course, it is not a cheap solution, but in some cases,this is the best type of configuration that we find for very large sites.
The best way to dispatch a high traffic WordPress site is to manage different websiteservices on several nodes or servers. It makes your website avoids centralized activity on a single server that could easily be overloadedto process many requests at once.
You can even place several servers with the same task. It can make that performance will further improve and reduce the consumption of resources on each server.
Since those are the technical activities that not everyone is capable to do, you can consider buying HostingRaja for managed enterprise hosting. They provide best-in-class managed WordPress hosting that helps you deal with anything technical things on your web hosting while your blog grows.