Install RHEL 7.x

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:

To install RHEL, see the RHEL documentation.

Additional RHEL configuration

Edit RHEL configuration files

  1. Read the postgres documentation on managing kernel resources corresponding to this link:

    http://www.enterprisedb.com/docs/en/9.5/pg/kernel-resources.html

  2. 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:

    #cat /proc/sys/kernel/threads-max
    

    An example of configuring nofile and nproc with moderate values:

    1. To edit the limits.conf files on each of the servers, run this command:

      # vi /etc/security/limits.conf
      
    2. 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
      
    3. 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
      
  3. 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:

    http://www.enterprisedb.com/docs/en/9.5/pg/kernel-resources.html

    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>

    Where:

    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

  4. 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:

    vm.overcommit_memory=2
    
    Note: 

    This setting is recommended only for systems with swap areas larger than their physical memory.

  5. On both the application and the database server, activate the new sysctl settings. Run this command:

    # sysctl -p
    
  6. 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:

    http://www.enterprisedb.com/docs/en/9.5/pg/wal-reliability.html

    Avoid disk controllers that have non-battery-backed write caches.