8. ontp-tsdb config#

8.1. Metric Database Configuration#

At the heart of the configuration options that we have to modify, there are the following tuneable postgres and timescaledb parameters.

  • Note: -c supplied with the arugments as it is assumed that we are launching via docker.

Warning

The following are rought guidelines on the memory requirements for your ontp-tsdb or ontp-tsdb-ml instance.

8.1.1. Basic Variables Shared Across Config Types#

 1
 2 -cssl=on
 3 -cssl_cert_file=/var/lib/postgresql/server.crt
 4 -cssl_key_file=/var/lib/postgresql/server.key
 5 -cshared_buffers=5GB
 6 -cmax_locks_per_transaction=500
 7 -cmax_connections=500
 8 -ceffective_cache_size=5GB
 9 -cmaintenance_work_mem=2GB
10 -ccheckpoint_completion_target=0.9
11 -cwal_buffers=16MB
12 -cdefault_statistics_target=100
13 -crandom_page_cost=1.1
14 -ceffective_io_concurrency=200
15 -cwork_mem=1GB
16 -cmin_wal_size=2GB
17 -cmax_wal_size=4GB
18 -cmax_worker_processes=24
19 -cmax_parallel_workers_per_gather=4
20 -cmax_parallel_workers=8
21 -cmax_parallel_maintenance_workers=4
22 -ctimescaledb.max_background_workers=16

8.1.2. Cluster Access Node Variables#

1
2 -cmax_prepared_transactions=500
3 -cstatement_timeout=600
4 -cenable_partitionwise_aggregate=on
5 -cjit=off

8.1.3. Cluster Data Node Variables#

1
2-cmax_prepared_transactions=500
3-cjit=on

8.1.4. Small Configuration#

  • Less than 20 nodes

 1
 2 -cssl=on
 3 -cssl_cert_file=/var/lib/postgresql/server.crt
 4 -cssl_key_file=/var/lib/postgresql/server.key
 5 -cshared_buffers=5GB
 6 -cmax_locks_per_transaction=500
 7 -cmax_connections=500
 8 -ceffective_cache_size=5GB
 9 -cmaintenance_work_mem=2GB
10 -ccheckpoint_completion_target=0.9
11 -cwal_buffers=16MB
12 -cdefault_statistics_target=100
13 -crandom_page_cost=1.1
14 -ceffective_io_concurrency=200
15 -cwork_mem=1GB
16 -cmin_wal_size=2GB
17 -cmax_wal_size=4GB
18 -cmax_worker_processes=24
19 -cmax_parallel_workers_per_gather=4
20 -cmax_parallel_workers=8
21 -cmax_parallel_maintenance_workers=4
22 -ctimescaledb.max_background_workers=16

8.1.5. Medium Configuration#

  • Less than 200 nodes

 1
 2 -cssl=on
 3 -cssl_cert_file=/var/lib/postgresql/server.crt
 4 -cssl_key_file=/var/lib/postgresql/server.key
 5 -cshared_buffers=10GB
 6 -cmax_locks_per_transaction=500
 7 -cmax_connections=500
 8 -ceffective_cache_size=7GB
 9 -cmaintenance_work_mem=4GB
10 -ccheckpoint_completion_target=0.9
11 -cwal_buffers=16MB
12 -cdefault_statistics_target=100
13 -crandom_page_cost=1.1
14 -ceffective_io_concurrency=200
15 -cwork_mem=3GB
16 -cmin_wal_size=3GB
17 -cmax_wal_size=5GB
18 -cmax_worker_processes=24
19 -cmax_parallel_workers_per_gather=4
20 -cmax_parallel_workers=8
21 -cmax_parallel_maintenance_workers=4
22 -ctimescaledb.max_background_workers=16

8.1.6. Large Configuration#

  • Less than 10K nodes

 1
 2 -cssl=on
 3 -cssl_cert_file=/var/lib/postgresql/server.crt
 4 -cssl_key_file=/var/lib/postgresql/server.key
 5 -cshared_buffers=20GB
 6 -cmax_locks_per_transaction=500
 7 -cmax_connections=500
 8 -ceffective_cache_size=8GB
 9 -cmaintenance_work_mem=5GB
10 -ccheckpoint_completion_target=0.9
11 -cwal_buffers=16MB
12 -cdefault_statistics_target=100
13 -crandom_page_cost=1.1
14 -ceffective_io_concurrency=200
15 -cwork_mem=5GB
16 -cmin_wal_size=5GB
17 -cmax_wal_size=8GB
18 -cmax_worker_processes=24
19 -cmax_parallel_workers_per_gather=4
20 -cmax_parallel_workers=8
21 -cmax_parallel_maintenance_workers=4
22 -ctimescaledb.max_background_workers=16

8.1.7. Distrubuted Database Configuration#

  • Greater than 10K nodes

 1
 2 -cssl=on
 3 -cssl_cert_file=/var/lib/postgresql/server.crt
 4 -cssl_key_file=/var/lib/postgresql/server.key
 5 -cshared_buffers=35GB
 6 -cmax_locks_per_transaction=1000
 7 -cmax_connections=1000
 8 -ceffective_cache_size=15GB
 9 -cmaintenance_work_mem=10GB
10 -ccheckpoint_completion_target=0.9
11 -cwal_buffers=16MB
12 -cdefault_statistics_target=100
13 -crandom_page_cost=1.1
14 -ceffective_io_concurrency=200
15 -cwork_mem=10GB
16 -cmin_wal_size=8GB
17 -cmax_wal_size=16GB
18 -cmax_worker_processes=32
19 -cmax_parallel_workers_per_gather=8
20 -cmax_parallel_workers=12
21 -cmax_parallel_maintenance_workers=16
22 -ctimescaledb.max_background_workers=18