Tune operating system

You need to tune the operating system for optimal performance with Swarm64 DA and EPAS.
  1. Create a file /etc/sysctl.d/99-swarm64.conf with the following content:
    fs.aio-max-nr=1048576
    fs.file-max=1000000

    Set these limits to a high value so that a large number of files can be open at the same time. This is needed e.g. by the columnstore index, parallel vacuum and parallel index creation.

    kernel.numa_balancing=0

    Disable NUMA balancing to avoid stalls while the kernel migrates pages between NUMA nodes.

    vm.swappiness=0

    The choice of the optimal value for this parameter should take into account the type of workloads served. For dedicated database servers a value between 0 to 10 is considered advisable.

    vm.zone_reclaim_mode=0

    Disable zone reclaiming to prevent the kernel from migrating pages between NUMA nodes when running out of socket-local memory.

    vm.hugtelb_shm_group=PG_GROUP

    Allow EPAS to use hugepages. Where PG_GROUP is the group ID the postmaster process runs as.

  2. Update the file /etc/security/limits.conf with the following lines:
    *  hard  nofile  1000000
    *  soft  nofile  1000000

    Set these limits to a high value so that a large number of files can be open at the same time. This is needed e.g. by the columnstore index, parallel vacuum and parallel index creation.

  3. Update the number of opened file limit in systemd:
    echo 'DefaultLimitNOFILE=1000000' >> /etc/systemd/system.conf

    Set this limit to a high value so that a large number of files can be open at the same time. This is needed e.g. by the columnstore index, parallel vacuum and parallel index creation.

  4. Apply the new sysctl configuration:
    sysctl --system
  5. Disable transparent hugepages:
    echo never > /sys/kernel/mm/transparent_hugepage/defrag
    echo never > /sys/kernel/mm/transparent_hugepage/enabled

    Disable transparent hugepages as well as defragmentation for optimal performance with EPAS.

    Note: After a reboot of the host system, the transparent hugepages are enabled again. To disable them permanently, see the documentation of your Linux distribution.
  6. Allocate 2 MiB hugepages:
    echo 10000 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

    Allocate enough hugepages so that the database can use them on demand.

    You can check how many pages are free and usable for the database with the following command:

    cat /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages
    Note: After a reboot of the host system, the 2 MiB hugepages are gone again. To allocate them permanently, see the documentation of your Linux distribution.
  7. Restart EPAS.