pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Moench-Tegeder <cmt@burggraben.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Out of Memory
Date: Thu, 27 Sep 2018 08:30:39 +0200
Message-ID: <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net> (raw)
In-Reply-To: <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at>
References: <1537536021272-0.post@n3.nabble.com>
	<1537900459605-0.post@n3.nabble.com>
	<18741.1537906384@sss.pgh.pa.us>
	<1537909379739-0.post@n3.nabble.com>
	<1537971881585-0.post@n3.nabble.com>
	<3321.1537972628@sss.pgh.pa.us>
	<1537973357976-0.post@n3.nabble.com>
	<1537979068444-0.post@n3.nabble.com>
	<1537979569920-0.post@n3.nabble.com>
	<824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at>

## Laurenz Albe (laurenz.albe@cybertec.at):

> vm.overcommit_memory = 2
> vm_overcommit_ratio = 100
> 
> Linux commits (swap * overcommit_ratio * RAM / 100),
                      ^
                      That should be a "+".

See Documentation/sysctl/vm.txt and Documentation/vm/overcommit-accounting.rst
in your kernel tree.

> so without any swap the correct value would be 100.
> 
> I don't know how safe it is to got entirely without swap.

That's completely safe. Even more: if your production machine ever needs
swap, it's already mostly dead in the water. So there's also no benefit in
having the kernel copy stuff to swap "just in case" (read: set sysctl
vm.swappiness to 0) and use the swap disk space for something more
productive. If your memory usage ever exceeds available memory, something
already went horribly wrong, and you want to know about it right now.
A good way to know about this kind of mistakes is having stuff fail
hard, obviously and loudly (i.e. Out Of Memory). Do not try to save
some day by swapping: stuff is "sometimes slow" and if you really need
the swap, everything crawls to a halt anyway.
Of course, this does not hold for personal workstations and
the like where you might want to use the swap space for suspend to
disk, or have some buffer in case of runaway processes.

Regards,
Christoph

-- 
Spare Space.




view thread (58+ messages)  latest in thread

Message-ID: <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net>
Permalink:  ../20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net/
Also on:    postgresql.org/message-id/20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: cmt@burggraben.net
  Subject: Re: Out of Memory
  In-Reply-To: <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net>
  References: <1537536021272-0.post@n3.nabble.com> <1537900459605-0.post@n3.nabble.com> <18741.1537906384@sss.pgh.pa.us> <1537909379739-0.post@n3.nabble.com> <1537971881585-0.post@n3.nabble.com> <3321.1537972628@sss.pgh.pa.us> <1537973357976-0.post@n3.nabble.com> <1537979068444-0.post@n3.nabble.com> <1537979569920-0.post@n3.nabble.com> <824208787ca76bb05c1076b72629e394c6ed660b.camel@cybertec.at> <20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox