Q/A on RDS Parameter Group
Parameter Group
โ What is parameter group in RDS?
๐ It's a group of variables that can be used on the database(s). These variables are pre-defined. We can use these variables to our advantage. Ex: by enabling log variable I can get logs. can set maximum connection my DB can have ...MAX_CONNECTIONS = 500, etc.
โ For enhanced monitoring what parameters I need to use?
๐ General_log = 1:
The default value is 0 or no logging. These are just general logs
๐ Slow_query_log = 1:
The default value is 0 or no logging., it's a boolean param. This should be enabled for enhance monitoring log. This simply means query that takes longer time to process, give me logs of them. Now by longer time means the values we set could be 0.001 sec or 60 sec etc. We set this value in the below parameter.
๐ Long_query_time = value_in_sec:
To log queries that run longer. This should be enabled for enhance monitoring log....it's kinda like timer.
๐ log_output = FILE:
To write both the general and the slow query logs to the file system and allow viewing these logs from the Amazon RDS console. It could be of the form file or
๐ log_output =TABLE:
default value writes the queries to a table so you can view these logs with a query.
๐ Also AWS RDS by default it gives MySQL error log. To get slow query logs / general logs need to set parameters in parameter group
MySQL error logs are found only during starting up of the system and shutdown, not when something write/read entries are happening.
โ How can I edit parameter group value?
๐ Default parameter group cannot be changed.
๐ It's a good practice to create a parameter group first and while creating RDS cluster add the parameter group created before.
Custome parameter group: i.e. created by you:
๐ Any updates are done then changes apply to all DB instances that are associated with that parameter group.
๐Changes done in the dynamic parameter, gets applied immediately regardless of the Apply Immediately setting.
๐Changes done in the static parameter gets applied only when you manually reboot the DB instance.
๐ If you update Parameter groups itself ex: from ParameterGroup: A to ParameterGroup: B changes take effect only when it is rebooted manually.
๐If it shows pending-reboot most likely changes aren't reflected in DB instances so manually reboot it
๐ Back up your data before modifying a DB parameter group.