8

So I'm fairly new to AWS and I'm hoping you guys can reassure me as I couldn't find anything in the AWS documentation either way. I actually have two questions, the first:

I have an RDS MySql instance in AWS that wasn't set up by myself (a previous employee did this). This instance is more powerful than we need so I want to reduce it's instance class in order to reduce costs. The current instance is a multi-AZ configuration.

  1. Can I simply change it and apply the changes at the next maintenance schedule without losing data?

  2. How can I identify how much of the RDS storage is currently in use? As I'd like to decrease this if possible as we aren't even using 50% of it.

2 Answers 2

8

Changing Instance Class:

From the documentation "Modifying a DB Instance and Using the Apply Immediately Parameter", changing the instance class and setting "Apply Immediately" to false will result in:

  • The change being applied during the next maintenance window.
  • The change causing an outage to occur.

Since the instance is Multi-AZ and you're changing the instance class, your outage will be minimized to the amount of time it takes to failover to the standby replica. That isn't very long; likely worst-case a minute or two. You won't lose data that is already in the DB. Any existing connections will be dropped during failover. You should verify that applications connected to your database can withstand these conditions, or alternatively take them down for maintenance during this time.

Identifying RDS instance storage capacity:

You can identify how much of the RDS storage is currently in use by either:

1) Simply selecting your RDS instance from the RDS web console and viewing the "Storage" bar under the "Monitoring" header.

2) Viewing the "FreeStorageSpace" RDS cloudwatch metric for your RDS instance.

Further Reading:

1

If you are still struggling with RDS costs, you need to evaluate your application usage of RDS.

You can reduce the instance type by figuring out what how the application uses the DB: the CPU and memory usage.

You can reduce disk size and also reduce backup costs. To see the table sizes, run this:

SELECT CONCAT(table_schema, '.', table_name),
       CONCAT(ROUND(table_rows / 1000000, 2), 'M')                                    rows,
       CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G')                    DATA,
       CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G')                   idx,
       CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
       ROUND(index_length / data_length, 2)                                           idxfrac
FROM   information_schema.TABLES
ORDER  BY data_length + index_length DESC
LIMIT  10;

Removing multi AZ will save you money, but it depends on if you need the "HA-ish" nature it offers you or not.

I wrote something about this here. Hope it's helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.