Skip to main content

PostgreSQL Settings Calculator

Generate optimized PostgreSQL configurations based on your server specifications

Select a predefined template or customize your own settings.

Total RAM on your server (up to 512 GB)

Memory reserved for the OS and essential services

For web servers, apps, or other services

Affects InnoDB flush method

Affects I/O capacity and optimizations

Enter your server specifications above to see recommendations.

Generate configuration file based on current settings

Performance Score

Recommendations

Frequently Asked Questions

What is shared_buffers?

shared_buffers sets the amount of memory PostgreSQL uses for shared memory buffers. The recommended starting point is 25% of total system memory. Unlike MySQL's buffer pool, PostgreSQL relies heavily on the OS page cache, so setting this too high can actually hurt performance.

What is effective_cache_size?

effective_cache_size provides an estimate to the query planner of how much memory is available for disk caching. It includes both shared_buffers and OS file system cache. A good starting value is 75% of total system memory. This setting does not allocate memory — it only informs the planner.

How does work_mem affect queries?

work_mem sets the amount of memory used for sort operations and hash tables before writing to temporary disk files. A single complex query can use multiple units of work_mem simultaneously. Setting this too high with many connections can exhaust memory; too low causes frequent disk spills.

Why use a connection pooler?

PostgreSQL creates a new process for each connection, using about 10MB of memory each. Connection poolers like PgBouncer or pgpool-II multiplex many client connections over fewer server connections, dramatically reducing memory usage and improving performance.

What does random_page_cost control?

random_page_cost tells the query planner the estimated cost of a non-sequential disk page fetch. For SSDs and NVMe drives, set this to 1.1 (close to sequential cost). For HDDs, the default of 4.0 is appropriate. Incorrect values can cause the planner to choose suboptimal query plans.

Are these settings optimal for all scenarios?

No, these are general recommendations based on PostgreSQL best practices. Optimal settings depend on your specific workload, data size, and query patterns. Use pg_stat_statements, EXPLAIN ANALYZE, and monitoring tools like pgBadger to fine-tune for your environment.