Skip to content

Commit

Permalink
chore: Increase number of connections for local postgres (#1023)
Browse files Browse the repository at this point in the history
## What ❔

- Increases `max_connections` in postgres (locally) from 100 to 200.
- Hopefully, it'll reduce the problems with integration tests in CI.

## Why ❔

- A single server (main node or EN) instance by default uses a
connection pool size of 50, and it spawns several additional unique
connections, making the total slightly higher than 50.
- In integration tests, we run the server and the EN simultaneously,
resulting in more than 100 connections being utilized.
- We recently bumped SQLx to 0.7, which [seems to have problems with
that](launchbadge/sqlx#2848).
- ...with 200 connections supported, we will be below the threshold
again, so it might help.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
popzxc authored Feb 7, 2024
1 parent dc6081e commit 908ac42
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose-cpu-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- ./.env
postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
ports:
- 127.0.0.1:5432:5432
environment:
Expand Down
1 change: 1 addition & 0 deletions docker-compose-gpu-runner-cuda-12-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ services:
- capabilities: [gpu]
postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
ports:
- 127.0.0.1:5432:5432
environment:
Expand Down
1 change: 1 addition & 0 deletions docker-compose-gpu-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- capabilities: [gpu]
postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
ports:
- 127.0.0.1:5432:5432
environment:
Expand Down
1 change: 1 addition & 0 deletions docker-compose-zkstack-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
container_name: geth
postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
container_name: postgres
ports:
- "127.0.0.1:5432:5432"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ services:
- ./volumes/prysm:/consensus
postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
ports:
- 127.0.0.1:5432:5432
volumes:
Expand Down

0 comments on commit 908ac42

Please sign in to comment.