O
O
Oleg Petrov2017-10-30 17:21:20
PostgreSQL
Oleg Petrov, 2017-10-30 17:21:20

How to store postgres 8.4 base in memory?

I was told that for frequent queries of the same type, you can store the entire database in RAM.
What setting allows you to do this?
I have a 200GB base - will this method work for me?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2017-10-30
@melkij

Buy a piece of iron with 256GB of ram and above. Set shared_buffers to 200gb. Everything. Over time, all the data that was accessed will be pulled into memory. And since there are more buffers than the base, the base will not force them out of memory.
It would be possible to use pg_prewarm to more conveniently pull data into memory after the start of the DBMS - yes, you have some kind of fossil version that has not been supported for a long time. There is no pg_prewarm for such antiquity. (unless, of course, you made a typo in 9.4)
For such a volume of shared_buffers, it is desirable to make huge pages a couple of percent larger in volume than shared_buffers. But how - maybe for 8.4 and nothing, I'm not that old DBA, I don't know.

K
ky0, 2017-10-30
@ky0

Postgres has built-in mechanisms that do much the same - frequently used data is cached in memory. Keeping the entire database in memory is somewhat different, usually this is not required, with a sufficient amount of memory issued by the DBMS.
Relevant options include disabling fsync (not recommended) and synchronous_commit .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question