Re: Limiting memory allocation - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Limiting memory allocation
Date
Msg-id a4b6b255-1206-7486-ddd2-048606b181ef@wi3ck.info
Whole thread Raw
In response to Limiting memory allocation  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Limiting memory allocation
List pgsql-hackers
On 5/17/22 15:42, Stephen Frost wrote:
> Thoughts?

Yes.

The main and foremost problem is a server that is used for multiple 
services and they behave differently when it comes to memory allocation. 
One service just allocates like we have petabytes of RAM, then uses 
little of it, while another one is doing precise accounting and uses all 
of that. These two types of services don't coexist well on one system 
without intervention.

Unfortunately swap space has been shunned as the ugly stepchild of 
memory in recent years. It could help in this regard to bring back swap 
space, but don't really intend to use it.

Using cgroups one can actually force a certain process (or user, or 
service) to use swap if and when that service is using more memory than 
it was "expected" to use. So I have a server with 64G of RAM. I give 16G 
to Postgres as shared buffers and another 16G to work with. I assume 
another 16G of OS buffers, so I restrict the Apache-Tomcat stuff running 
on it to something like 8-12G. After that, it has to swap. Of course, my 
Postgres processes also will have to swap if they need more than 16G of 
overall workmem ... but that is what I actually intended. I may have to 
reduce workmem, or max_connections, or something else.


Regards, Jan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Zstandard support for toast compression
Next
From: Stephen Frost
Date:
Subject: Re: Zstandard support for toast compression