How does memory overcommit affect PostgreSQL?

In Linux 2.4 and later, the default virtual memory behavior is not optimal for PostgreSQL. Because of the way that the kernel implements memory overcommit, the kernel may terminate the PostgreSQL server (the postmaster process) if the memory demands of another process cause the system to run out of virtual memory.

If this happens, you will see a kernel message
Out of Memory: Killed process 12345 (postmaster).

This indicates that the postmaster process has been terminated due to memory pressure. Although existing database connections will continue to function normally, no new connections will be accepted. To recover, PostgreSQL will need to be restarted.

One way to avoid this problem is to run PostgreSQL on a machine where you can be sure that other processes will not run the machine out of memory.

On Linux 2.6 and later, a better solution is to modify the kernel’s behavior so that it will not “overcommit” memory. This is done by selecting strict overcommit mode via sysctl:

sysctl -w vm.overcommit_memory=2

or placing an equivalent entry in /etc/sysctl.conf. You may also wish to modify the related setting vm.overcommit_ratio. For details see the kernel documentation file Documentation/vm/overcommit-accounting.

  • Email, SSL
  • 0 Bu mövzunu faydalı görən istifadəçilər:
Bu mövzu kifayət qədər köməkçi oldu?

Related Articles

Manage Tablespaces

Tablespaces in PostgreSQL allow database administrators to define locations in the file system...

Fix nameservers not working for Linux servers

If you have your own namerservers or you are using nameservers provided by host, and these...

ColdFusion DSN parameters are not updated

SYMPTOMS New CF DSN records are created.  Even the set of parameters is tried to be updated...

Restore a database on SQL Server using .mdf, .ldf and .ndf files?

You need to attach the database rather than perform a restore. Using Enterprise Manager: Expand...

After restoring a SQL Server database, it show a status of “Loading”

Getting the database out of LOADING state When restoring multiple backups, each backup needs...