If you are using provisioned instances for your AWS Aurora PostgreSQL, RDS MySQL, or MariaDB databases, upgrading to equivalent Graviton2 instances gives you immediate savings of 10% and a 20% improvement in performance. This technical blog only addresses the situation when you are using standard Aurora, with provisioned database instances. AWS Aurora Serverless is fully managed and does not give you any control over instance types.
Should you use Aurora or Aurora Serverless?
AWS Aurora comes in 3 versions:
- Aurora (uses DB instances)
- Aurora Serverless version 1
- Aurora Serverless version 2
The provisioned DB engine mode is designed for predictable workloads, whereas the Serverless modes are designed for highly variable workloads. If you have a steady workload, using Aurora Serverless is significantly more expensive.
As 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. 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). In this case, 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-production environment first.
Brief upgrade steps
- 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 (if necessary, upgrade 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
Detailed upgrade instructions
- 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, and 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.
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 better do databases perform on Graviton2?
The Percona comparison of Aurora PostgreSQL hosted on Graviton2 and x86 showed a 30% improvement in transactions per second (tps) for Graviton2 over equivalent x86 instances.To ensure that your AWS services and environments are always optimized and compliant with AWS best practices, check out CloudFix.