Using timescaledb-tune

To streamline the configuration process, we’ve created a tool called timescaledb-tune that handles setting the most common parameters to good values based on your system, accounting for memory, CPU, and PostgreSQL version. timescaledb-tune is packaged along with our binary releases as a dependency, so if you installed one of our binary releases (including Docker), you should have access to the tool. Alternatively, with a standard Go environment, you can also go get the repository to install it.

timescaledb-tune reads your system’s postgresql.conf file and offers interactive suggestions for updating your settings:

  1. Using postgresql.conf at this path:
  2. /usr/local/var/postgres/postgresql.conf
  3. Is this correct? [(y)es/(n)o]: y
  4. Writing backup to:
  5. /var/folders/cr/zpgdkv194vz1g5smxl_5tggm0000gn/T/timescaledb_tune.backup201901071520
  6. shared_preload_libraries needs to be updated
  7. Current:
  8. #shared_preload_libraries = 'timescaledb'
  9. Recommended:
  10. shared_preload_libraries = 'timescaledb'
  11. Is this okay? [(y)es/(n)o]: y
  12. success: shared_preload_libraries will be updated
  13. Tune memory/parallelism/WAL and other settings? [(y)es/(n)o]: y
  14. Recommendations based on 8.00 GB of available memory and 4 CPUs for PostgreSQL 11
  15. Memory settings recommendations
  16. Current:
  17. shared_buffers = 128MB
  18. #effective_cache_size = 4GB
  19. #maintenance_work_mem = 64MB
  20. #work_mem = 4MB
  21. Recommended:
  22. shared_buffers = 2GB
  23. effective_cache_size = 6GB
  24. maintenance_work_mem = 1GB
  25. work_mem = 26214kB
  26. Is this okay? [(y)es/(s)kip/(q)uit]:

These changes are then written to your postgresql.conf and will take effect on the next (re)start. If you are starting on fresh instance and don’t feel the need to approve each group of changes, you can also automatically accept and append the suggestions to the end of your postgresql.conf like so:

  1. $ timescaledb-tune --quiet --yes --dry-run >> /path/to/postgresql.conf