For information about what RHEL release to use, see Software requirements Red Hat Enterprise Linux.
This section covers only new installations on both the Application and Database servers, if applicable.
In addition to RHEL default installation setting, install RHEL with these options:
Select the Role Basic Server
To install RHEL, see the RHEL documentation.
Edit RHEL configuration files
Read the postgres documentation on managing kernel resources corresponding to this link:
Postgres uses several parallel processes and many open files. Set resource limits according to the postgres documentation http://www.enterprisedb.com/docs/en/9.5/pg/kernel-resources.html (section 17.4.2).
Increase the number of open files for the systems that are driving the database, and ensure that nofile is set to less than the limit for the operating system.
Retrieve the max value for the operating system from:
# cat /proc/sys/fs/file-max
Increase the number of threads for the driver for this workload, and ensure that noproc is set to less than the limit for the operating system.
Retrieve the max number of threads from:
An example of configuring nofile and nproc with moderate values:
To edit the limits.conf files on each of the servers, run this command:
# vi /etc/security/limits.conf
On the database server, add specific nofile and nproc values for enterprisedb and lcm to the limits.conf file, for example:
* soft nofile 65535 * hard nofile 65535 enterprisedb soft nproc 65535 enterprisedb hard nproc 65535 lcm soft nproc 65535 lcm hard nproc 65535
On the application server, add specific nofile and nproc values for lcm to the limits.conf file, for example:
* soft nofile 65535 * hard nofile 65535 lcm soft nproc 65535 lcm hard nproc 65535
On both the application and database servers:
This command produces valid starting values by asking getconf for information about the memory in your system.
For a more detailed calculation of the required shared memory, refer to the postgres documentation on managing kernel resources corresponding to this link:
Run these commands to get the value from $shmmax and $shmall:
# page_size=`getconf PAGE_SIZE` # phys_pages=`getconf _PHYS_PAGES` # shmall=`expr $phys_pages / 2` # shmmax=`expr $shmall \* $page_size` # echo $shmmax # echo $shmall
Add these two lines to /etc/sysctl.conf:
kernel.shmmax = < value from $shmmax> kernel.shmall =< value from $shmall>
shmmax is the maximum size (in bytes) for a single shared memory segment
shmall is the total amount of shared memory (in pages) that all processes on the server can use
On the database server only, change read caching.
Linux has a tendency to let processes allocate more RAM than the system has, in hopes not all of it will actually be used. This Linux overcommit behavior should be disabled on a postgres server by making this change to the sysctl configuration.
Add this line to the /etc/sysctl.conf file:
On both the application and the database server, activate the new sysctl settings. Run this command:
# sysctl -p
On the database server, disable write caching on drives.
For more information, refer to the postgres documentation on reliability and write-ahead log, corresponding to this link:
Avoid disk controllers that have non-battery-backed write caches.