How can I set up Postgres to use given amount of RAM?

Started by W.P.almost 4 years ago4 messagesgeneral
Jump to latest
#1W.P.
laurentp@wp.pl

Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables  I run queries on?

As I can see disk actity running queries.

W.P..

#2Zahid Rahman
zahidr1000@gmail.com
In reply to: W.P. (#1)
Re: How can I set up Postgres to use given amount of RAM?

https://severalnines.com/database-blog/architecture-and-tuning-memory-postgresql-databases

On Sun, 26 Jun 2022, 11:40 pm W.P., <laurentp@wp.pl> wrote:

Show quoted text

Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables I run queries on?

As I can see disk actity running queries.

W.P..

#3Mladen Gogala
gogala.mladen@gmail.com
In reply to: W.P. (#1)
Re: How can I set up Postgres to use given amount of RAM?

On 6/26/22 14:40, W.P. wrote:

Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than
2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables  I run queries on?

As I can see disk actity running queries.

W.P..

I would try docker with --memory option. An alternative is to create a
VM with the given amount of memory. If your laptop is memory starved,
then creating a VM is probably not an option. Docker is much cheaper.
Dockerfile is relatively simple to master and you can use Docker to run
almost anything.

Regards

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

#4Andreas Joseph Krogh
andreas@visena.com
In reply to: W.P. (#1)
Sv: How can I set up Postgres to use given amount of RAM?

På søndag 26. juni 2022 kl. 20:40:01, skrev W.P. <laurentp@wp.pl
<mailto:laurentp@wp.pl>>:
Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tables I run queries on?

As I can see disk actity running queries.

W.P..
The closest thing I can think of is effective_cache_size:
https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE

<https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE&gt;

--
Andreas Joseph Krogh