From e9703bd7218271c68df00b6fe4255e68f37a000d Mon Sep 17 00:00:00 2001 From: James Lucas Date: Mon, 16 Dec 2024 09:41:40 -0600 Subject: [PATCH] Server: Increase default max pool sizes (#1567) Also improve documentation around tuning the parameters. --- README.md | 4 ++-- server/svix-server/config.default.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 314109135..d6d356245 100644 --- a/README.md +++ b/README.md @@ -245,9 +245,9 @@ You can see more in [these instructions](./OpenTelemetry.md). ### Connection Pool Size -There are two configuration variables `db_pool_max_size` and `redis_pool_max_size` which control the maximum allowed size of the connection pool for PostgreSQL and Redis respectively. +The `db_pool_max_size` configuration parameter controls the maximum allowed size of the connection pool for PostgreSQL. This value defaults to a max size of 100, but you can potentially increase application performance significantly by increasing this value. You may need to consider Postgres and PGBouncer configuration parameters as well when tuning these parameters. -They default to a max size of 20, but higher values can significantly increase performance if your database can handle it. +The `redis_pool_max_size` parameter controls the maximum size of each Svix instance's Redis connection pool. Its default is 100. Note that only redis _queuing_ leverages connection pooling -- caching is fully asynchronous and so does not otherwise benefit from pooling. Therefore, you probably won't need to tune this parameter. ### SSRF Attacks and Internal IP Addresses To prevent SSRF attacks, message dispatches to internal IP addresses are blocked by default. However we understand that this doesn't meet the needs of every user say, for example, the service can only be accessed internally. To bypass these restrictions, see the `whitelist_subnets` configuration option, which accepts an array of CIDR-notation subnets to allow messages to be dispatched to. diff --git a/server/svix-server/config.default.toml b/server/svix-server/config.default.toml index 286b053b6..a3ea09c3b 100644 --- a/server/svix-server/config.default.toml +++ b/server/svix-server/config.default.toml @@ -61,7 +61,7 @@ db_dsn = "postgresql://postgres:postgres@pgbouncer/postgres" # The maximum number of connections for the PostgreSQL pool. Minimum value is 10. # Higher values can significantly increase performance if your database can handle it. -db_pool_max_size = 20 +db_pool_max_size = 100 # The default DSN for redis. `queue_dsn` and `cache_dsn` with take precedence over this value. # (can be left empty if not using redis or if Redis is configured through the queue and/or cache @@ -70,7 +70,7 @@ db_pool_max_size = 20 # The maximum number of connections for the Redis pool. Minimum value of 10 # Higher values can significantly increase performance if your database can handle it. -redis_pool_max_size = 20 +redis_pool_max_size = 100 # What kind of message queue to use. Supported: memory, redis, rediscluster # Redis backends must have a redis_dsn or queue_dsn configured, and it's highly recommended to