based on the following article: An Introduction to PostgreSQL Performance Tuning and Optimization
- huge pages: Enabling on Linux will give a performance boost to PostgreSQL (VMPeak / HugePageSize = 4310)
- max_connections: optimal number is roughly 4 times the number of CPU cores. The recommended number is the GREATEST(4 x CPU cores, 100). Beyond this number, a connection pooler such as pgbouncer should be used. avoid setting max_connections too high as it will increase the size of various data structures in Postgres which can result in CPU cycles being wasted
- shared_buffers: variable by workload - starting Point: LEAST(RAM/2, 10GB).
- work_mem: ((Total RAM - shared_buffers)/(16 x CPU cores))
- maintenance_work_mem: 1GB good start
- effective_io_concurrency: SSD = 200, HDD = Number of Disks