In this infrastructure with autoscaling, the code is not synchronized, it is shared. This requires an Elastic File System (EFS) which we will create in the following tutorial. The creation and configuration of Amazon EFS are needed to share the document root of WordPress without the need of having continuous synchronizations. The data should be the same in all the instances of autoscaling.
Keep in mind that this is just the 4th Part of our sequence of How to create a High-Performance WordPress with Autoscaling on AWS.
Step by Step to create an Amazon EFS
- An account on AWS
Step by step:
1. Login on the AWS account.
2. Verify the region in which the infrastructure will be created. In the upper right corner, click on the button with the city name and choose the region, in this case, it will be Virginia.
3. Select the EFS service.
4. Click on “Create file system”.
5. Select the VPC and the private subnet. Press “Next Step”.
6. Assign a name to the EFS and choose the performance mode, it is recommended to keep the value by default. Then, press “Next Step”.
7. Review the configurations and create the EFS.
8. Verify the correct creation of the EFS.
*Note: Verify in the Security Group, that the value of the origin (source) of the traffic is the private network or 0.0.0.0/0.
- Connect to the instance via SSH.
- Mount EFS in the instance.
a) Click on “Amazon EC2 mount instructions”.
Follow the instructions shown.
The results of this test are as follows:
- Writing a 500 Mb file in the EFS took 4.74519 seconds with a speed of 100 Mb / s.
- In a local directory, writing the same file took 7.34338 seconds with a speed of 71.4 Mb / s.
This means that the I/O of the EFS is faster than a local directory.
And that’s it! Those are all the steps that you need to follow to create an Elastic Fyle System. Remember that the objective of this tutorial is to create a high-performance and Auto-scalable WordPress. Do not forget to go to see the whole process and the other tutorials we have prepared for you.