Change the Query Cache Size Amazon AWS RDS

We are running a PHP web site with the Mysql RDS from Amazon, there is a need to change the PHP cache size to make the server run more effectively. Normally this would be done in the my.cnf file but as you know with RDS you use the parameter groups. If you don’t have the RDS tools on your server then look to the another blogg by me for the instructions on getting it up and running Change the max_allowed_packet Amazon RDS

Once you have it working then back here.

You only need to do this part if you did not create a parameter group

rds-create-db-parameter-group NAMEOFGROUP -f DATABASEVERSION -d “My custom database parameter group”

NAMEOFGROUP – If this is a single multi used database, give it a generic name otherwise give it the name of the RDS name

DATABASEVERSION – at the time of writing mysql5.1 mysql5.5


rds-create-db-parameter-group mydbgroup -f mysql5.1 -d “My custom database parameter group”

This has now created the shell to store the parameters such as max_allowed_packet but in this case the query cache size

rds-modify-db-parameter-group NAMEOFGROUP –parameters “name=query_cache_size,value=3048576,method=immediate”

rds-modify-db-parameter-group NAMEOFGROUP –parameters “name=query_cache_type,value=1,method=pending-reboot”


NOTE the pending-reboot, for this setting to take effect the database needs a recycle.

Read up on the query_cache stuff in the MySQL site and forums, this blog is all about how you set things in AWS and not how to tune your MySQL server.

Again you only need to do this if you created the group from scratch

rds-modify-db-instance your-instance-here –db-parameter-group-name NAMEOFGROUP


Substitute you RDS instance name (your-instance-here and NAMEOFGROUP)

You will need to restart the RDS instance to get these settings to take effect.


6 Comments on “Change the Query Cache Size Amazon AWS RDS”

  1. […] Change the Query Cache Size Amazon AWS RDS […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s