sudo dnf install tuned
sudo systemctl start tuned
sudo systemctl enable tuned
Below are a few steps to show how we use tuned to manually adjust system settings (or static-tuning):
- Listing existing profiles
tuned-adm list
- To activate a profile or to reactivate a profile after you have revised it,
sudo tuned-adm active postgresql
In this example, we have created a profile of our own to tune the system for running PostgreSQL Database Management System.
- Create a directory at
/etc/tuned
, e.g., if we wish to have a profile calledpostgresql
, we create the directorypostgresql
at/etc/tuned
,
sudo mkdir /etc/tuned/postgresql
- Create a profile at the directory you created, e.g., create
tuned.conf
at/etc/tuned/postgresql
. The following is an example profile for PostgreSQL
$ cat /etc/tuned/postgresql/tuned.conf # # tuned configuration # [main] summary=Optimize for running PostgreSQL inside a virtual guest [cpu] governor=performance energy_perf_bias=performance min_perf_pct=100 [disk] readahead=>4096 [sysctl] vm.dirty_ratio = 2 vm.dirty_background_ratio=1 vm.overcommit_memory=2 vm.swappiness = 0 vm.nr_hugepages=1192 [vm] transparent_hugepages=never
This profile basically sets the system to use 2MB hugepages for PostgreSQL. It is worth nothing that in the PostgreSQL's$PGDATA/postgresql.conf
configuration file, we have these lines:
shared_buffers = 2GB huge_pages = on
Since shared buffers is 2GB/(hugepage size) = 2GB/2MB = 1024 pages, thevm.nr_hugepages
(the number of reserved hugepages) cannot be less than 1024 pages plus additional pages for the process itself and others; otherwise, PostgreSQL will fail to start.
No comments:
Post a Comment