Skip to content

Commit eb77e89

Browse files
committed
ci: Apply PostgreSQL performance optimizations to GitHub Actions
1 parent 6b44f92 commit eb77e89

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ jobs:
177177
- run: sudo systemctl start postgresql.service
178178
- run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
179179

180+
# Apply PostgreSQL performance optimizations for test speed
181+
# WARNING: These settings sacrifice data durability for speed - test environments only!
182+
- run: |
183+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET fsync = off;"
184+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET wal_level = minimal;"
185+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET full_page_writes = off;"
186+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET checkpoint_timeout = '10min';"
187+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '256MB';"
188+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET synchronous_commit = off;"
189+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET max_wal_senders = 0;"
190+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "SELECT pg_reload_conf();"
191+
180192
- run: cargo build --tests --workspace
181193
- run: cargo test --workspace
182194

0 commit comments

Comments
 (0)