WhatsApp / WhatsApp-Business-API-Setup-Scripts

The scripts related to setting up WhatsApp business API
MIT License
404 stars 425 forks source link

WA_DB_CONNECTION_IDLE_TIMEOUT postgresql alternative #91

Open lukas-becker0 opened 1 year ago

lukas-becker0 commented 1 year ago

According to the documentation this env variable is only supported when using MySQL.

WA_DB_CONNECTION_IDLE_TIMEOUT (only supported by MySQL) — By setting this environment variable (in milliseconds) while starting the Coreapp, you can set the idle timeout for your MySQL database. The MySQL server will then close any database connections that are idle for the time set.

There is a similar server side option idle_session_timeout since postgresql 14 but currently you do not support postgresql 14.x.

For now we have set the idle_in_transaction_session_timeout to the value you recommend for WA_DB_CONNECTION_IDLE_TIMEOUT but sinceidle_in_transaction_session_timeout is only for transactions it is not equivalent to the behavior of WA_DB_CONNECTION_IDLE_TIMEOUT with MySQL.

We are currently looking into the following alternatives:

  1. Using the pgbouncer middleware which has a server_idle_timeout option
  2. Using a combination of TCP postgresql settings (tcp_keepalives_idle, tcp_keepalives_interval, tcp_user_timeout) to close idle connections

Do you have any recommendations for an alternative for WA_DB_CONNECTION_IDLE_TIMEOUT when using postgresql ? Are there any plans to add support for WA_DB_CONNECTION_IDLE_TIMEOUT when using postgresql ? Also are there any plans to support postgresql 14.x in the near future ?

facebook-github-bot commented 1 year ago

Hi lukas-becker0 (https://github.com/lukas-becker0),

Thank you for your comment. This GitHub repo is not actively monitored. If you need help, please check previously asked questions in the WA Business API Developer Community, or raise a Direct support ticket. Meanwhile, we are happy to continue with less time-sensitive discussions in GitHub.

Thanks for your understanding!