Skip to content

Commit

Permalink
test: +pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorsalgado committed Mar 6, 2024
1 parent ad8e7fe commit 9898059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
network_mode: host
environment:
- DB_CONNECTION_STRING=postgresql://rinha:rinha@0.0.0.0:6432/rinha?sslmode=disable
- DB_POOL_SIZE=10
- ADDR=8081
- NODE_ENV=production
- UV_THREADPOOL_SIZE=1
Expand All @@ -28,6 +29,7 @@ services:
network_mode: host
environment:
- DB_CONNECTION_STRING=postgresql://rinha:rinha@0.0.0.0:6432/rinha?sslmode=disable
- DB_POOL_SIZE=10
- ADDR=8082
- NODE_ENV=production
- UV_THREADPOOL_SIZE=1
Expand Down Expand Up @@ -84,7 +86,7 @@ services:
dockerfile: Dockerfile.bouncer
container_name: bouncer
environment:
PGB_DATABASES: rinha = host=0.0.0.0 port=5432 pool_mode=statement pool_size=20
PGB_DATABASES: rinha = host=0.0.0.0 port=5432 pool_mode=statement pool_size=30
PGB_ADMIN_USERS: rinha
PGB_ADMIN_PASSWORDS: rinha
network_mode: host
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { Pool } = native
import fastJson from 'fast-json-stringify'

const DbConnectionString = process.env.DB_CONNECTION_STRING ?? 'postgresql://rinha:rinha@0.0.0.0:5432/rinha?sslmode=disable'
const DbPoolSize = process.env.DB_POOL_SIZE ?? 5
const Addr = process.env.ADDR ?? 8080

const Clientes = new Map()
Expand All @@ -17,7 +18,7 @@ const Clientes = new Map()

const pool = new Pool({
connectionString: DbConnectionString,
max: 5,
max: DbPoolSize,
connectionTimeoutMillis: 5 * 1000
})

Expand Down

0 comments on commit 9898059

Please sign in to comment.