Skip to content

Commit

Permalink
Server: Increase default max pool sizes (#1567)
Browse files Browse the repository at this point in the history
Also improve documentation around tuning the parameters.
  • Loading branch information
jaymell authored Dec 16, 2024
1 parent 74e5206 commit e9703bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions server/svix-server/config.default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e9703bd

Please sign in to comment.