Deltablue logoDeltablue wordmark
menu
Blogpost
Passage of time

3 minute read

Scaling Drupal

What to keep in mind when scaling Drupal projects.

Using Drupal is a great way to build web applications. It is an open source platform with a large supporting community, meaning that most of the features you are looking for in an application can be found ( and downloaded for free ) on the web. This is probably the main reason why a lot of agencies choose Drupal as the backbone for their applications.

The main purpose of almost every website is to attract as much visitors as possible, but unfortunately not every website is built to handle massive amounts of visitors. When the number of (concurrent) visitors keeps increasing up to a point where the current server setup can no longer keep up, the result will be ever increasing response times or even website downtime. It goes without saying that this is something you want to avoid at all costs, as it will result in users staying away, meaning, in the end, money loss.

A similar situation occurs when your audience is widely spread across the globe; There is a saying that goes “There is no cloud, there’s only someone else’s computer”, meaning that if you visit a website, you are always accessing somebody’s hardware somewhere on the planet. This also means, that if you live e.g. in France and you visit a website which is hosted in a distant location ( let’s say China ), there will be latency on your connection, resulting in identical slow response times or downtime. For the record, hosted means the physical location of the server, not the url location… or else said: www.mywebsite.fr is not necessarily hosted in France, but can be hosted anywhere.

Luckily, DeltaBlue can help you in avoiding or fixing these issues.

One of our customers is a global player in the market of professional work tools. They came to us with a Drupal website and the question to improve global performance. As the entire application stack was hosted in Europe, the website was slower to visitors from the US or Asia. Main question was that visitors in every part of the world could experience the site in identical, fast ways. To make a long story short, here are some recommendations to building scalable Drupal websites:

GeoDNS Setup

  • Start off with horizontal scaling in a global context: Add a point of presence (Apache or Nginx webserver) in every region you want to reach out to people.

  • Use GeoDNS to redirect users to the right hosts, based on their location. Setting up a globally scaled network without guiding users to the closest hosts, would be a total waste of time and resources. You want users from the US to land on US hosts and spanish users to land on spanish hosts.

  • Use a MySQL Percona Cluster to access the database on several MySQL Servers. This means that every Apache Server can connect to a database that is physically closeby, hence reducing latency. Check that there is as minimal latency as possible between the MySQL and the webserver, which does not necessarily mean they have to be in the same datacenter, or that there has to be a one-on-one correlation between web- and database servers!

  • By default, Drupal stores session data in the database. By moving this data to a shared key value store, such as Redis or Memcached, it becomes possible to perform actions on the setup without altering session data. Extracting the session data enabled us to scale the application up and down without any of the logged in users noticing anything.

  • Store public and private files in a Shared File System. In our setup we have multiple locations with full file replication to keep files in sync on all locations. At first we tried to setup a shared file system using S3 in a single location, but we soon found out that the existing Drupal modules for S3 were not adequate and caused themselves issues with response times. In the end we used Unison for file replication.

On one hand this setup allows you to scale your application to cope with enormous amounts of traffic. On the other hand it allows to serve your brilliant content equally blazing fast to people all over the world. Of course the application itself needs to support this type of scaling, but don’t worry, DeltaBlue has a team of professional developers who can help you (or your developers).