Timescale Cloud:性能、扩展、企业级

自托管产品

MST

为了让 TimescaleDB 配置更简单,您可以使用 timescaledb-tune工具。该工具会根据您的系统(包括内存、CPU 和 PostgreSQL 版本)自动设置最常用的参数为最佳值。timescaledb-tune 作为依赖项与 TimescaleDB 二进制版本一起打包,因此如果您是从二进制版本(包括 Docker)安装的 Timescale,您应该已经可以使用该工具。此外,您也可以使用 go install 命令进行安装。

go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest

timescaledb-tune 工具会读取您系统的 postgresql.conf 文件,并为您提供交互式的设置建议。以下是该工具运行的示例:

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/example/T/timescaledb_tune.backup202101071520
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 12
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]:

当您回答完问题后,更改将被写入您的 postgresql.conf 文件中,并在您下次重启时生效。

如果您是在新实例上开始使用,并且不想逐一批准每组更改,您可以在运行该工具时使用一些附加标志,自动接受并将建议附加到 postgresql.conf 文件的末尾。

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

关键词

此页面有问题?报告问题 或 在 GitHub 上编辑此页面