Aurora comes in 3 versions:
- Aurora (Uses Db instances)
- Aurora Serverless version 1
- Aurora Serverless version 2
This technical note only addresses the situation when you are using standard Aurora, with provisioned database instances. Aurora Serverless is fully managed and does not give you any control over instance types.
Should you use Aurora or Aurora Serverless?
The provisioned DB engine mode is designed for predictable workloads. Whereas the Serverless mode is designed for highly variable workloads. If you have a steady workload, using Aurora Serverless is significantly more expensive.
To give an example:
Aurora Serverless utilization is measured in Aurora Capacity Units (ACU). Each ACU is a combination of approximately 2 gigabytes (GB) of memory, corresponding CPU, and networking. So, for an application that is expected to serve constant traffic in US-East-1, an r6g.large RDS instance (16 GB, $0.26/hour) would be the equivalent of 8 ACUs (@$0.06/hr = $0.48/hr). Aurora Serverless would be 85% more expensive.
Why move to Graviton2?
- Graviton2 instances provide up to 52% price/performance improvement for RDS open-source databases depending on database engine, version, and workload. They also provide up to 35% price/performance improvement for Aurora depending on database size.
- Graviton2 instances provide seven times the performance, four times the number of compute cores, two times larger private caches per core, five times faster memory, and two times faster floating-point performance per core over the first-generation AWS Graviton processors.
- Graviton2 processors feature always-on fully encrypted DDR4 memory and 50% faster per core encryption performance.
- No porting or code changes are required when migrating from Intel to Graviton2 instances on Amazon RDS and Aurora.
How to Upgrade
Be safe, your data is valuable – Take a backup, and test migration in a non-prod environment first.
- Take a snapshot to enable rollback if necessary
- For safety, test on a non-production setup first
- Check that your DB version is supported on Graviton2 (Upgrade if you must to a supported Db version)
- Migrate a single read replica to Graviton2, and failover to make it the primary
- Test your application for a few days, then progressively migrate other read replicas to Graviton2
- Take a snapshot of your database – it will give you a chance to rollback your changes. Don’t skip this step.
- Check that your database version is supported on Graviton2, Upgrade the database (if necessary):
- Determine if your current database version meets the minimum required version for moving to Graviton2. (List: Aurora MySQL 2.09.2 and higher, PostgreSQL version is 11.9 and higher, 12.4 and higher, or 13.3)
- Modify the instance types:
- If you have read replicas:
- Upgrade the instance type of one of the read replicas to Graviton2
- Promote the just upgraded read replica to the primary
- It is a good idea to wait a day or two to check the performance of your application and to make sure there are no problems.
- If you don’t have at least read replicas, it is a good idea to create one temporarily, otherwise you will have cluster downtime while the instance change occurs.
- If you have read replicas:
- Validate and confirm that your application works correctly. If you have performance insights enabled, this will give you a view of queries and waits.
- If your application works and there are no issues, you can now migrate your other replicas one at a time.
NB: A change of instance type means a relocation of the instance to another hardware host, which means that the buffer cache isn’t maintained. Therefore, when the database on the modified instance restarts, the buffer cache is cold and initial queries might take longer.
Can you Revert your changes?
Yes. You can change back to your previous instance type by following the inverse of the upgrade process. Failover to a non-Graviton 2 Instance to make it primary, then revert the Graviton2 Instance type to another type.
How much will you save?
You will get just over 10% of actual direct cost savings.
How much better do databases perform on Graviton2?
The Percona comparison of PostgreSQL hosted on Graviton2 and x86 showed a 30% improvement in transactions per second (tps) for Graviton2 over equivalent x86 instances.
Achieve up to 35% better price/performance with Amazon Aurora using new Graviton2 instances. (n.d.). Amazon Web Services, Inc. Retrieved October 25, 2021, from Read more
Achieve up to 52% better price/performance with Amazon RDS using new Graviton2 instances. (n.d.). Amazon Web Services, Inc. Read more
Augustine, J. (2021, January 26). PostgreSQL on ARM-based AWS EC2 Instances: Is It Any Good? Percona Database Performance Blog. Read more
Korotkov, A. (2021, April 30). Dramatical Effect of LSE Instructions for PostgreSQL on Graviton2 . . . – Alexander Korotkov’s blog. Read more
Bauskar, K. (2020, April 7). MySQL on x86 vs ARM. MySQL On ARM. Read more
Swan, C. (2020, March 11). Benchmarks for Amazon’s Graviton2 Arm Processor. InfoQ. Read more
Key considerations in moving to Graviton2 for Amazon RDS and Amazon Aurora databases. (2021, March 23). Amazon Web Services. Retrieved October 25, 2021, from Read more