Tune postgresql memory and I/O settings for system controllers

Reduce work_mem from 512MB to 32MB to better handle increased
connection counts in scale environments. The previous value was a
legacy setting from when Ceilometer's complex queries required higher
memory allocation.

Increase shared_buffers from 80MB to 256MB to improve database caching
performance for large queries.

Tune random_page_cost and effective_io_concurrency parameters to
optimize I/O performance for solid state drives.

Test Plan:
01. PASS - Build an ISO with the commit and install a system controller
    with it, verify that the install completes successfully and that
    PostgreSQL starts successfully with the new config.
02. PASS - Run basic load test to confirm there's no performance
    degradation.
03. PASS - Monitor resource-intensive Distributed Cloud operations in a
    scale environment (e.g. dcmanager-audit) and verify they complete
    successfully.
04. PASS - Check logs for any warnings, errors or slow queries.

Story: 2011106
Task: 51246

Change-Id: Idb43369b3e11590a50226cfaa0c903a091586de2
Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
This commit is contained in:
Gustavo Herzmann 2024-11-01 18:23:32 -03:00
parent 9240927b58
commit d405647ecb

View File

@ -189,22 +189,29 @@ class platform::postgresql::server
}
} else {
# System controller or standard controller
# 1500 connections, 80MB shared_buffers, increase work_mem and
# 10000 connections, 256MB shared_buffers, increase work_mem and
# checkpoint_segments
# TODO:
# - re-assess work_mem setting considering the complexity of the current
# queries.
# - re-assess shared_buffers setting for the system controller in a large
# distributed cloud.
postgresql::server::config_entry { 'max_connections':
value => '10000',
}
postgresql::server::config_entry { 'shared_buffers':
value => '80MB',
value => '256MB',
}
postgresql::server::config_entry { 'work_mem':
value => '512MB',
value => '32MB',
}
# Optimized I/O settings for SSD on system controller:
# Lower random read costs (4 to 1.1) and increase parallel I/O operations (1 to 200)
if $::platform::params::distributed_cloud_role == 'systemcontroller' {
postgresql::server::config_entry { 'random_page_cost':
value => '1.1',
}
postgresql::server::config_entry { 'effective_io_concurrency':
value => '200',
}
}
if $::osfamily == 'Debian' {
postgresql::server::config_entry { 'max_wal_size':
# checkpoint_segments was replaced by min_wal_size and max_wal_size