mysqldatabaseamazon-web-servicesamazon-rdsamazon-aurora

AWS RDS max_connections


Using Aurora MySql DB Engine in a project. I have been trying to modify the max_connections parameter of the instance. But the current default value of the parameter in the instance parameter group gives,

GREATEST({log(DBInstanceClassMemory/805306368)*45},{log(DBInstanceClassMemory/8187281408)*1000}) Eg: for db.r5.large instance class the parameter will resolve to,

RAM 16 GiB = 16 * 1024 * 1024 * 1024 = 17,179,869,184 bytes log(17179869184/805306368) * 45 ≈ 59.80635 log(17179869184/8187281408) * 1000 ≈ 322.21 max_parameter ≈ 322.21

But, According to the official document it is db.r5.large - 1000 https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Managing.Performance.html

Which is the correct value?

Also tried the sql query to get the value which also gives as 1000. What am I missing?


Solution

  • From the official docs, it is log base 2.

    https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_ParamValuesRef.html#USER_ParamLogExpressions

    To calculator, you can use tool such as: https://www.omnicalculator.com/math/log-2

    Based on the default config of your parameter which is:

    GREATEST({log(DBInstanceClassMemory/805306368)*45},{log(DBInstanceClassMemory/8187281408)*1000})
    

    Let assume the RDS db.r5.large instance type has 17179869184 Bytes.

    https://instances.vantage.sh/aws/rds/db.r5.large

    With log base 2 of 2nd part, it returns ~ 1069.3 which is quite near with the value when you use SELECT query inside your DB.