Serverless, Laravel and RDS Serverless Benchmarks
We have created benchmarks for our Laravel + SLS boilerplate to demonstrate its scalability and to set priorities for the future. To complete our benchmarking, we used a slightly modified version of our demo application that could be put through load tests.
For the purposes of these tests, we didn’t want to optimize the Laravel application for speed. Instead, we focused on assessing and benchmarking the infrastructure around it. This will enable us to concentrate for the time being on the entire operation of our infrastructure. It also helps us identify any root issues that could impact speed and performance.
For testing, the S3 counter implementation was deactivated, and all connected queues were switched off in order to have synchronous processing. During the page call, the MySQL database was read and written once. The DynamoDB was handled in the same way.
AWS RDS Aurora Serverless MySQL 5.6
The aim of each of our benchmarking tests was to get a feel for the required RDS ACUs for our application. We were particularly interested in determining exactly how many requests per second the ACUs are capable of processing. Of course, we have found that you don’t have to worry about these small quantities when using DynamoDB.
1 ACU has approximately 2 GB of memory with associated CPU and network capacity, similar to the user-provided Aurora instances.
- 0,090€ per GB per month for storage
- 0,18€ per 1MM IO Requests
Auto scaling behavior
On the screenshot you can see the behavior of the autoscaling very well. A RDS aurora serverless database takes about 10 minutes to scale from 1 ACU 1 to 8 ACUs.
Costs compared to an AWS RDS Aurora MySQL non serverless database
The RDS Aurora serverless variant is therefore almost 3 times as expensive then a classic RDS Aurora instance.
ECS Fargate comparison
We configured an RDS aurora serverless database with 8 ACUs and got the following request per seconds with an this ECS Fargate cluster with 2 x 4 VCUs.
Lambda + Gateway prices
As an example, we took figures from 2 of our applications and compared the costs with Lambda & Gateway. Let’s just take a look at the ECS cluster and the EC2 costs without databases.
- ECS/EC2 costs
- Lambda + API Gateway costs
The two applications serve very different customers and have a very large difference in traffic behavior, especially the highly provisioned App1 for large traffic peaks shows a huge price difference to serverless hosting.
With the App2 the difference is not quite so big but this application, of course, always exists in X different environments (stage, feature-1, feature-2, …).