Date: 2022-12-10
Accepted
We want to have a fast and highly available PostgreSQL instance.
- LoadBalancer
- Optimization
- For optimizing PostgreSQL configurations, we will use the tool available at pgtune.leopard.in.ua. This tool generates configuration files that provide the optimal settings based on the system's hardware and expected workload, improving database performance.
- LoadTest
max_connectionsshared_buffers- use for cache [15..25%] RAMeffective_cache_size[50%…75%] RAMwork_mem- RAM for request (WARNING: count_session * work_mem).
# Set timeout (in seconds) before a query cancels:
ALTER DATABASE mydatabase SET statement_timeout = '60s';checkpoint_segments[10-256]
- We have a fast and highly available PostgreSQL instance.
- We can use
pgBouncerfor load balancing. - We can use
pgTunefor tuning PostgreSQL.