-
Notifications
You must be signed in to change notification settings - Fork 73
1.1 Configuring Postgres for Archive
Changing the Postgres Configuration to best fit the needs of archive helps with data indexing, particularly when using Archive in a highly-threaded environment (setting block_workers
to 8+ in archive config).
Postgres has a few variables to help keep up with the rate of indexing that archive accomplishes. For a quick way to tune your Postgres configuration to sensible defaults for your machines hardware, I've found PGTune to be a useful tool.
Configuration of most important variables (Comprehensive list of configuration options here. This article is also helpful when tuning.)
There's no one configuration for every setup out there. It's best to read through some of the documentation with what is written here, and choose the best values for your hardware setup.
Value | Description | Default Value | Recommended Value |
---|---|---|---|
shared_buffers |
Sets the amount of memory the database server uses for shared memory buffers. | 128MB | 25% of RAM |
effective_cache_size |
Memory available for disk caching by the OS and Database | 4GB | 50% of RAM |
max_worker_processes |
Sets the maximum number of background processes that the system can support. | 8 | Number of Logical Threads |
max_parallel_workers |
Sets the maximum number of workers that the system can support for parallel operations. | 8 | Number of Logical Threads |
max_parallel_maintenance_workers |
Sets the maximum number of parallel workers that can be started by a single utility command. | 2 | Threads / 4 |
max_parallel_workers_per_gather |
Sets the maximum number of workers that can be started by a single Gather or Gather Merge node. | 2 | Threads / 2 |