PostgreSQL memory settings can look generous yet become dangerous under concurrency. With shared_buffers = 12GB and work_mem = 2GB, a 100-client pgbench run produced roughly the same or slightly worse throughput, showing that larger values did not help. section 6.2
When per-query memory overwhelms the host
Increasing max_connections to 1000 made the stress test hang after 10 seconds. work_mem can allocate 2GB for each execution-plan node in each running query; many nodes, concurrent sessions, and parallel execution can quickly exceed available RAM. The Linux OOM killer may terminate PostgreSQL or another critical process. PostgreSQL then terminates other active backends and enters crash recovery. section 6.2
Safer operational guidance:
- Size work_mem for realistic concurrent execution rather than treating it as a single global query allocation. section 6.2










