PostgreSQL and the OOM killer: Why we use strict memory overcommit
1–10 of 140 posts
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#2I've gone through this exercise in the past on much older kernels which they cover as well and just me personally I ran into less issues by leaving overcommit to 0 and just dropping the overcommit ratio to 0 and setting the oom_score_adj for programs as high as 1000 if I wanted vmscan to leave them alone and of course using the Redhat formulas for setting vm.min_free_kbytes, vm.admin_reserve_kbytes, vm.user_reserve_kbytes. And of course be vigilant in disallowing app owners from using every last bit of memory.
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#3Unfortunately, many programs commit 2x memory than they actually use. Often I see ~32GB committed and ~16GB resident.
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#4For now, we have overcommit_ratio set to a value that is stable from experience, but there really seems to be no silver lining. Go is very happy to allocate a lot of virtual memory, but so are most managed languages. The best solution would probably be to host the backend and the database on separate servers.
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#5Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#6I agree with the blog post's technical contents, but I feel we came across too strong in the title. For Ubicloud as a managed Postgres provider, we use strict memory overcommit. Our experience with operating Postgres at scale taught us that it's better to enable this than going with the defaults.
However, I can see many other scenarios, where using strict memory overcommit would have unanticipated side-effects. That's why Linux doesn't go with strict memory commit as its default.
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#7This has bitten me multiple times. The problem I have is that at work we deploy the application (written in Go) and PostgreSQL on the same machine. The backend app allocates a lot of virtual memory, and initially we had overcommit to 0 (heuristic). This caused crashes on big queries in PostgreSQL and we set it to 2. The whole system became a bit unstable because the backend would still allocate a lot of virtual memor…
Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#8Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#9Re: PostgreSQL and the OOM killer: Why we use strict memory overcommit
#10I have disabled overcommit both on Windows and on Linux. I hate having random programs being killed. Unfortunately, many programs commit 2x memory than they actually use. Often I see ~32GB committed and ~16GB resident.