- Newest
- Most votes
- Most comments
For Amazon RDS for MySQL, the default value for both interactive_timeout and wait_timeout is 28,800 seconds, which is equivalent to 8 hours.
The interactive_timeout parameter specifically refers to the number of seconds the server waits for activity on an interactive connection before closing it. An interactive client is defined as a client that uses the CLIENT_INTERACTIVE option to perform mysql_real_connect().
As for wait_timeout, it applies to non-interactive connections and serves a similar purpose of timing out idle connections.
Regarding best practices for setting these values:
- The appropriate settings depend on your specific environment and workload.
- If you encounter errors related to connections being closed unexpectedly, you might need to gradually increase these values until the errors are resolved.
- It's generally recommended to keep these timeout values reasonably low to prevent idle connections from consuming resources unnecessarily. However, setting them too low might cause issues for legitimate long-running queries or transactions.
- Consider your application's behavior and connection patterns when adjusting these values. For example, if your application has long-running transactions or queries, you might need higher timeout values.
- Monitor your database performance and connection usage to fine-tune these parameters over time.
Remember that changing these parameters may require a restart of your RDS instance, so plan accordingly when making adjustments.
Hi,
default value for interactive_timeout and wait_timeout are both 28,800.
I'd suggest to read this blog post above to get advice on how to optimize the values for your use case.
Best,
Didier
Another tip: when the source for the parameter is engine-default that means it will use the same value as the documented engine defaults:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout
$ aws rds describe-engine-default-parameters --db-parameter-group-family mysql8.0 --query 'EngineDefaults.Parameters[?ParameterName==`wait_timeout`].{ParameterName:ParameterName, Source:Source}'
[
{
"ParameterName": "wait_timeout",
"Source": "engine-default"
}
]
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
Thank you very much. This is definitely what I am looking for.
Hi, glad that you found the right info! Thanks for accepting my answer.