skip to Main Content

I want to set the idle_in_transaction_session_timeout parameter group setting of our RDS postgres database. Any suggestions on how I should approach this? Whats the right value? What should I look at to decide on the optimal value.

2

Answers


  1. idle_in_transaction_session_timeout defines the maximum time an idle transaction can stay open before being automatically rolled back.

    To choose an optimal value for the parameter you can follow below steps:

    • Identify typical transaction durations for your applications and start with a conservative value slightly above your longest expected transaction duration.
    • Monitor database performance and resource usage after applying the change.
    • Look for metrics like:
      • Active connections, idle connections, blocked connections.
      • Average transaction duration, long-running transactions.
      • Lock waiting time, CPU and memory utilization.

    Now based on the metrics and observations Adjust and monitor:

    • If there are many idle transactions being rolled back, it might indicate a value too low. Increase it gradually.
    • If resource usage remains high due to long-running idle transactions, the value might be too high. Decrease it cautiously, ensuring long-running processes can complete.
    • Continuously monitor and adapt the setting based on your observed behavior.
    Login or Signup to reply.
  2. Ask the people who coded the application how long a database transaction can take in the worst case. Then set idle_in_transaction_session_timeout to ten times that value. I would suggest 10 seconds as a reasonable minimum value for this parameter, but typically it will be much higher.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search