Part of preparing the app for hosting many customers as one container per customer.
Problem
src/main.rs creates the pool with a fixed max_connections(10). With one instance per customer on a shared PostgreSQL server, a hundred instances may open up to 1000 connections, far above the PostgreSQL default of 100.
Suggested fix
Add an optional max_connections key to the [database] section of the config (default 10, so existing installations behave the same), and add it to config_sample.toml.
Consider also setting a small min_connections and an idle timeout so idle instances release their connections.
Document that many instances on one server need either a low limit per instance or PgBouncer in front of PostgreSQL.
Done when
The pool size can be set per instance in the config.
Unit test for parsing the new key, with and without it.
Part of preparing the app for hosting many customers as one container per customer.
## Problem
`src/main.rs` creates the pool with a fixed `max_connections(10)`. With one instance per customer on a shared PostgreSQL server, a hundred instances may open up to 1000 connections, far above the PostgreSQL default of 100.
## Suggested fix
- Add an optional `max_connections` key to the `[database]` section of the config (default 10, so existing installations behave the same), and add it to `config_sample.toml`.
- Consider also setting a small `min_connections` and an idle timeout so idle instances release their connections.
- Document that many instances on one server need either a low limit per instance or PgBouncer in front of PostgreSQL.
## Done when
- The pool size can be set per instance in the config.
- Unit test for parsing the new key, with and without it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of preparing the app for hosting many customers as one container per customer.
Problem
src/main.rscreates the pool with a fixedmax_connections(10). With one instance per customer on a shared PostgreSQL server, a hundred instances may open up to 1000 connections, far above the PostgreSQL default of 100.Suggested fix
max_connectionskey to the[database]section of the config (default 10, so existing installations behave the same), and add it toconfig_sample.toml.min_connectionsand an idle timeout so idle instances release their connections.Done when