Thread: load the whole database into RAM
hello, I use pgsql to store data for my program (hotel manager). The filesystem reports that the size on disk of database is not so bing (~100MB ~20MB actual data). I want to tune the engine to fit the database as much as possible in RAM, say: postgres, please, use 512MB (1GB) of my RAM just for your needs and load everithing on it. Is it possible and, of course, effective? Just taking a look to some tuning document I didn't find a direct answer (I'm not a smart guy) Thanks, Filippo
On 27 Mar 2007 23:43:38 -0700, filippo <filippo2991@virgilio.it> wrote: > I use pgsql to store data for my program (hotel manager). The > filesystem reports that the size on disk of database is not so bing > (~100MB ~20MB actual data). I want to tune the engine to fit the > database as much as possible in RAM, say: postgres, please, use 512MB > (1GB) of my RAM just for your needs and load everithing on it. Is > it possible and, of course, effective? > > Just taking a look to some tuning document I didn't find a direct > answer (I'm not a smart guy) All modern operating systems do this without any extra effort on your part...all you can really do is get in the way. Just make sure there is enough ram in the box and let postgresql do its thing. I think in your case the only thing you should be considering is to turn fsync on (safe, slow, default) or off (unsafe, fast). merlin
On Tue, Mar 27, 2007 at 11:43:38PM -0700, filippo wrote: > I use pgsql to store data for my program (hotel manager). The > filesystem reports that the size on disk of database is not so bing > (~100MB ~20MB actual data). I want to tune the engine to fit the > database as much as possible in RAM, say: postgres, please, use 512MB > (1GB) of my RAM just for your needs and load everithing on it. Is > it possible and, of course, effective? Just put lots of RAM in the machine and let the OS cache it all. The only knob you'd really need to tune would be random_page_cost, which you could set at one (though perhaps effective_cache_size will handle that for you... Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.