All Projects → timescale → Timescaledb Tune

timescale / Timescaledb Tune

Licence: apache-2.0
A tool for tuning TimescaleDB for better performance by adjusting settings to match your system's CPU and memory resources.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Timescaledb Tune

Amazonriver
amazonriver 是一个将postgresql的实时数据同步到es或kafka的服务
Stars: ✭ 198 (-2.94%)
Mutual labels:  postgresql
Pgbadger
A fast PostgreSQL Log Analyzer
Stars: ✭ 2,522 (+1136.27%)
Mutual labels:  postgresql
Realtime
Listen to your to PostgreSQL database in realtime via websockets. Built with Elixir.
Stars: ✭ 4,278 (+1997.06%)
Mutual labels:  postgresql
Sqlingvo
A Clojure & ClojureScript DSL for SQL
Stars: ✭ 200 (-1.96%)
Mutual labels:  postgresql
Steampipe
Steampipe command line interface (CLI)
Stars: ✭ 200 (-1.96%)
Mutual labels:  postgresql
Koolreport
This is an Open Source PHP Reporting Framework which you can use to write perfect data reports or to construct awesome dashboards using PHP
Stars: ✭ 204 (+0%)
Mutual labels:  postgresql
Intermine
A powerful open source data warehouse system
Stars: ✭ 195 (-4.41%)
Mutual labels:  postgresql
Postgres
🐘 Run PostgreSQL in Kubernetes
Stars: ✭ 205 (+0.49%)
Mutual labels:  postgresql
Pgsodium
Modern cryptography for PostgreSQL using libsodium.
Stars: ✭ 202 (-0.98%)
Mutual labels:  postgresql
Tableplus
TablePlus macOS issue tracker
Stars: ✭ 2,554 (+1151.96%)
Mutual labels:  postgresql
Express Graphql Boilerplate
Express GraphQL API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 201 (-1.47%)
Mutual labels:  postgresql
Postgrest Docs
Documentation for
Stars: ✭ 202 (-0.98%)
Mutual labels:  postgresql
Pgsync
Postgres to elasticsearch sync
Stars: ✭ 205 (+0.49%)
Mutual labels:  postgresql
Pg rman
Backup and restore management tool for PostgreSQL
Stars: ✭ 197 (-3.43%)
Mutual labels:  postgresql
Qix
Machine Learning、Deep Learning、PostgreSQL、Distributed System、Node.Js、Golang
Stars: ✭ 13,740 (+6635.29%)
Mutual labels:  postgresql
Pgdeltastream
Streaming Postgres logical replication changes atleast-once over websockets
Stars: ✭ 197 (-3.43%)
Mutual labels:  postgresql
Fastapi Gino Arq Uvicorn
High-performance Async REST API, in Python. FastAPI + GINO + Arq + Uvicorn (w/ Redis and PostgreSQL).
Stars: ✭ 204 (+0%)
Mutual labels:  postgresql
Pginsight
CLI tool to easily dig deep inside your Postgresql database.
Stars: ✭ 205 (+0.49%)
Mutual labels:  postgresql
Shardingsphere
Build criterion and ecosystem above multi-model databases
Stars: ✭ 14,989 (+7247.55%)
Mutual labels:  postgresql
Rustorm
an orm for rust
Stars: ✭ 205 (+0.49%)
Mutual labels:  postgresql

timescaledb-tune

timescaledb-tune is a program for tuning a TimescaleDB database to perform its best based on the host's resources such as memory and number of CPUs. It parses the existing postgresql.conf file to ensure that the TimescaleDB extension is appropriately installed and provides recommendations for memory, parallelism, WAL, and other settings.

Getting started

You need the Go runtime (1.12+) installed, then simply go get this repo:

$ go get github.com/timescale/timescaledb-tune/cmd/timescaledb-tune

It is also available as a binary package on a variety systems using Homebrew, yum, or apt. Search for timescaledb-tools.

Using timescaledb-tune

By default, timescaledb-tune attempts to locate your postgresql.conf file for parsing by using heuristics based on the operating system, so the simplest invocation would be:

$ timescaledb-tune

You'll then be given a series of prompts that require minimal user input to make sure your config file is up to date:

Using postgresql.conf at this path:
/usr/local/var/postgres/postgresql.conf

Is this correct? [(y)es/(n)o]: y
Writing backup to:
/var/folders/cr/zpgdkv194vz1g5smxl_5tggm0000gn/T/timescaledb_tune.backup201901071520

shared_preload_libraries needs to be updated
Current:
#shared_preload_libraries = 'timescaledb'
Recommended:
shared_preload_libraries = 'timescaledb'
Is this okay? [(y)es/(n)o]: y
success: shared_preload_libraries will be updated

Tune memory/parallelism/WAL and other settings? [(y)es/(n)o]: y
Recommendations based on 8.00 GB of available memory and 4 CPUs for PostgreSQL 11

Memory settings recommendations
Current:
shared_buffers = 128MB
#effective_cache_size = 4GB
#maintenance_work_mem = 64MB
#work_mem = 4MB
Recommended:
shared_buffers = 2GB
effective_cache_size = 6GB
maintenance_work_mem = 1GB
work_mem = 26214kB
Is this okay? [(y)es/(s)kip/(q)uit]:

If you have moved the configuration file to a different location, or auto-detection fails (file an issue please!), you can provide the location with the --conf-path flag:

$ timescaledb-tune --conf-path=/path/to/postgresql.conf

At the end, your postgresql.conf will be overwritten with the changes that you accepted from the prompts.

Other invocations

If you want recommendations for a specific amount of memory and/or CPUs:

$ timescaledb-tune --memory="4GB" --cpus=2

If you want to set a specific number of background workers (timescaledb.max_background_workers):

$ timescaledb-tune --max-bg-workers=16

If you have a dedicated disk for WAL, or want to specify how much of a shared disk should be used for WAL:

$ timescaledb-tune --wal-disk-size="10GB"

If you want to accept all recommendations, you can use --yes:

$ timescaledb-tune --yes

If you just want to see the recommendations without writing:

$ timescaledb-tune --dry-run

If there are too many prompts:

$ timescaledb-tune --quiet

And if you want to skip all prompts and get quiet output:

$ timescaledb-tune --quiet --yes

And if you want to append the recommendations to the end of your conf file instead of in-place replacement:

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

Restoring backups

timescaledb-tune makes a backup of your postgresql.conf file each time it runs (without the --dry-run flag) in your temp directory. If you find that the configuration given is not working well, you can restore a backup by using the --restore flag:

$ timescaledb-tune --restore
Using postgresql.conf at this path:
/usr/local/var/postgres/postgresql.conf

Is this correct? [(y)es/(n)o]: y
Available backups (most recent first):
1) timescaledb_tune.backup201901222056 (14 hours ago)
2) timescaledb_tune.backup201901221640 (18 hours ago)
3) timescaledb_tune.backup201901221050 (24 hours ago)
4) timescaledb_tune.backup201901211817 (41 hours ago)

Use which backup? Number or (q)uit: 1
Restoring 'timescaledb_tune.backup201901222056'...
success: restored successfully

Contributing

We welcome contributions to this utility, which like TimescaleDB is released under the Apache2 Open Source License. The same Contributors Agreement applies; please sign the Contributor License Agreement (CLA) if you're a new contributor.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].