Search code examples
amazon-web-servicesamazon-ec2drupaljoomla

AWS - Can you autoscale an EC2 Instance with Drupal and Joomla! applications?


We have a temporary burst of traffic to one of our AWS EC2 instances.

This contains a number of Drupal and Joomla! CMS applications with RDS databases.

When the traffic peaks, it's maxing out CPU usage on the instance (m4.large).

We would like to setup AutoScaling to solve the issue, but Rackspace AWS support advises that the applications must be STATELESS.

Are Drupal and Joomla! Stateless?

Can an EC2 with these application be autoscaled in AWS?


Solution

  • Regarding drupal (probably similar for joomla as well).

    Durpal can run on AWS and use autoscaling. This is document and explained in the official AWS white paper:

    However, the key component for this to work (RDS you already have) is Elastic File System (EFS). It provides shared filesystem for all instances in the autoscaling group running drupal. This is necessary so that all instances have same files (e.g. images uploaded by a user) and the file system is immune to scaling in and out events of the auto-scaling group.

    From the white paper:

    Amazon Elastic File System (Amazon EFS) as the shared file system. Drupal instances share the file system, so changes to content made by one Drupal instance are visible to the other Drupal instances.

    So returning to your original question. By its nature, drupal is not stateless. But it can be made into one through the use of RDS and EFS. Thus with some effort you would have to modify/migrate current drupal installation to use EFS.

    For a quick fix the the cpu problem, you could consider upgrading to a stronger instance type.