Re: overcommit_ratio setting - Mailing list pgsql-performance

From Laurenz Albe
Subject Re: overcommit_ratio setting
Date
Msg-id ed9bdd0e15309e01c690319bb567558f2a912390.camel@cybertec.at
Whole thread Raw
In response to Re: overcommit_ratio setting  (Yi Sun <yinan81@gmail.com>)
Responses Re: overcommit_ratio setting  (Yi Sun <yinan81@gmail.com>)
List pgsql-performance
On Tue, 2021-06-15 at 08:34 +0800, Yi Sun wrote:
> > overcommit_ratio < (RAM - swap) / RAM * 100
> > 
> > Here, RAM is the RAM available to PostgreSQL.
> 
> Thank you for your reply
> 
> 1. Our env RAM are 4GB, 8 GB, 16 GB... as below url suggestion, could we configure swap as below?
> https://opensource.com/article/18/9/swap-space-linux-systems
> 
> RAM                 swap
> 
> 2GB – 8GB       = RAM
> >8GB                8GB

I wouldn't change the swap space to fit overcommit_ratio, but
the other way around.
With a properly configured PostgreSQL, you won't need a lot of swap space.

> 2. If the RAM is 4GB and 8GB, the formula  (RAM - swap) / RAM * 100 result will become to 0,
>    how could we configure overcommit_ratio please?

You have to use floating point arithmetic.

The result will only be 0 if RAM = swap.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-performance by date:

Previous
From: Haseeb Khan
Date:
Subject: Re: Master - Slave Replication Window Server
Next
From: Yi Sun
Date:
Subject: Re: overcommit_ratio setting