How it works...

In this case, it's all about the settings. Each of our two illustrated steps simply ensures that the settings are in a location where they become permanent parts of the server. Any future reboot will automatically apply these newly selected values instead of the defaults. The sysctl command activates them immediately, so we don't need to reboot to modify the system behavior.

The sched_migration_cost_ns setting is the total period of time the scheduler will consider a migrated process cache hot, and thus less likely to be migrated again. By default, this is 0.5 ms (or 500,000 ns). As the size of the process table increases, the complexity inherited by the process scheduler eventually results in high CPU overhead merely to assign ...

Get PostgreSQL 12 High Availability Cookbook 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.