What are the default values of interactive_timeout and wait_timeout in Amazon RDS?

0

Hello,

I'm working with Amazon RDS for MySQL, and I need to know the default values for the following parameters:

  1. interactive_timeout
  2. wait_timeout

I've checked the documentation but couldn't find specific details on the default settings for these parameters in Amazon RDS. Could anyone provide the current default values for both interactive_timeout and wait_timeout? Also, any best practice recommendations for setting these values based on common workloads would be appreciated.

Thank you!

3 Answers
2

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:

  1. The appropriate settings depend on your specific environment and workload.
  2. If you encounter errors related to connections being closed unexpectedly, you might need to gradually increase these values until the errors are resolved.
  3. 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.
  4. 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.
  5. 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.

Sources
Best practices for configuring parameters for Amazon RDS for MySQL, part 3: Parameters related to security, operational manageability, and connectivity timeout | AWS Database Blog

profile picture
answered a month ago
profile picture
EXPERT
reviewed a month ago
1
Accepted Answer

Hi,

As per https://aws.amazon.com/blogs/database/best-practices-for-configuring-parameters-for-amazon-rds-for-mysql-part-3-parameters-related-to-security-operational-manageability-and-connectivity-timeout/

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

profile pictureAWS
EXPERT
answered a month ago
profile picture
EXPERT
reviewed 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.

1

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"
    }
]
AWS
MODERATOR
answered a month ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions