Skip to content

Commit

Permalink
Add support for wal-disk-size parameter in timescaledb-tune script
Browse files Browse the repository at this point in the history
- Introduced TS_TUNE_WAL_DISK_SIZE environment variable
- Updated script to handle --wal-disk-size flag
  • Loading branch information
bastian-vogl authored and svenklemm committed Oct 1, 2024
1 parent 99c731f commit b9231e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker-entrypoint-initdb.d/001_timescaledb_tune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TS_TUNE_MEMORY=${TS_TUNE_MEMORY:-""}
TS_TUNE_NUM_CPUS=${TS_TUNE_NUM_CPUS:-""}
TS_TUNE_MAX_CONNS=${TS_TUNE_MAX_CONNS:-""}
TS_TUNE_MAX_BG_WORKERS=${TS_TUNE_MAX_BG_WORKERS:-""}
TS_TUNE_WAL_DISK_SIZE=${TS_TUNE_WAL_DISK_SIZE:-""}

if [ ! -z "${NO_TS_TUNE:-}" ]; then
# The user has explicitly requested not to run timescaledb-tune; exit this script
Expand Down Expand Up @@ -95,8 +96,12 @@ if [ ! -z "${TS_TUNE_MAX_BG_WORKERS:-}" ]; then
TS_TUNE_MAX_BG_WORKERS_FLAGS=--max-bg-workers=${TS_TUNE_MAX_BG_WORKERS}
fi

if [ ! -z "${TS_TUNE_WAL_DISK_SIZE:-}" ]; then
TS_TUNE_WAL_DISK_SIZE_FLAGS=--wal-disk-size="${TS_TUNE_WAL_DISK_SIZE}"
fi

if [ ! -z "${PG_MAJOR}" ]; then
TS_TUNE_PG_VERSION=--pg-version=${PG_MAJOR}
fi

/usr/local/bin/timescaledb-tune --quiet --yes --conf-path="${POSTGRESQL_CONF_DIR}/postgresql.conf" ${TS_TUNE_MEMORY_FLAGS} ${TS_TUNE_NUM_CPUS_FLAGS} ${TS_TUNE_MAX_CONNS_FLAGS} ${TS_TUNE_MAX_BG_WORKERS_FLAGS} ${TS_TUNE_PG_VERSION}
/usr/local/bin/timescaledb-tune --quiet --yes --conf-path="${POSTGRESQL_CONF_DIR}/postgresql.conf" ${TS_TUNE_MEMORY_FLAGS} ${TS_TUNE_NUM_CPUS_FLAGS} ${TS_TUNE_MAX_CONNS_FLAGS} ${TS_TUNE_MAX_BG_WORKERS_FLAGS} ${TS_TUNE_WAL_DISK_SIZE_FLAGS} ${TS_TUNE_PG_VERSION}

0 comments on commit b9231e6

Please sign in to comment.