How to do it...

If there's a /etc/sysctl.d directory, follow these steps to activate:

  1. Create a file named 30-postgresql.conf in the /etc/sysctl.d directory with the settings we mentioned earlier.
  2. Execute this command as a root-capable user to activate:
        sudo sysctl -p /etc/sysctl.d/30-postgresql.conf

Otherwise, follow these steps:

  1. Place the settings in /etc/sysctl.conf.
  2. Execute this command as a root-capable user to activate:
        sudo sysctl -p

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.