agora inbox for pgsql-docs@postgresql.orghelp / color / mirror / Atom feed
https://www.postgresql.org/docs/current/kernel-resources.html 2+ messages / 2 participants [nested] [flat]
* https://www.postgresql.org/docs/current/kernel-resources.html @ 2025-01-23 14:32 PG Doc comments form <noreply@postgresql.org> 2025-01-23 19:49 ` Re: https://www.postgresql.org/docs/current/kernel-resources.html Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 2+ messages in thread From: PG Doc comments form @ 2025-01-23 14:32 UTC (permalink / raw) To: pgsql-docs@lists.postgresql.org; +Cc: gibbsr@swebs.com The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/17/kernel-resources.html Description: The following: Another approach, which can be used with or without altering vm.overcommit_memory, is to set the process-specific OOM score adjustment value for the postmaster process to -1000, thereby guaranteeing it will not be targeted by the OOM killer. The simplest way to do this is to execute echo -1000 > /proc/self/oom_score_adj in the PostgreSQL startup script just before invoking postgres. Note that this action must be done as root, or it will have no effect; so a root-owned startup script is the easiest place to do it. If you do this, you should also set these environment variables in the startup script before invoking postgres: export PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj export PG_OOM_ADJUST_VALUE=0 These settings will cause postmaster child processes to run with the normal OOM score adjustment of zero, so that the OOM killer can still target them at need. You could use some other value for PG_OOM_ADJUST_VALUE if you want the child processes to run with some other OOM score adjustment. ---- I believe, that the export of PG_OOM_ADJUST_FILE should not point to the file that the postmaster uses, but should be for example: export PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj_child As if the example is blindly followed, then postmaster version of the file would be updated and become a candidate to be killed. If I've misunderstood then more detail needs to should why the PG_OOM_ADJUST_FILE should point to the same file for child and postmaster processes. Overall great work on the documentation, as I'm still newbe to PostreSQL but many years of using other databases. ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: https://www.postgresql.org/docs/current/kernel-resources.html 2025-01-23 14:32 https://www.postgresql.org/docs/current/kernel-resources.html PG Doc comments form <noreply@postgresql.org> @ 2025-01-23 19:49 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2025-01-23 19:49 UTC (permalink / raw) To: gibbsr@swebs.com; +Cc: pgsql-docs@lists.postgresql.org PG Doc comments form <noreply@postgresql.org> writes: > I believe, that the export of PG_OOM_ADJUST_FILE should not point to the > file that the postmaster uses, but should be for example: > export PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj_child > As if the example is blindly followed, then postmaster version of the file > would be updated and become a candidate to be killed. I don't think so. In the first place, you misunderstand what this variable does: it is only consulted by postmaster child processes not the postmaster itself. In the second place, "/proc/self/oom_score_adj_child" isn't universal (it does not exist on any of the Red-Hat-based distros I checked). If it were universal and had the semantics that I guess it means from the name, we could perhaps implement this feature differently and more simply. But it's not, and I don't see a lot of value in supporting two different implementations. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-01-23 19:49 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-01-23 14:32 https://www.postgresql.org/docs/current/kernel-resources.html PG Doc comments form <noreply@postgresql.org> 2025-01-23 19:49 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox