2010/8/3 Sim Zacks <sim@xxxxxxxxxxxxxx>: > Is there a way to tell what the optimal memory is for a specific > postgresql instance? > > I am configuring Xen virtual machines and I don't want to give it more > then it needs. > > Would looking at the swap be an indication? As soon as it starts to use > swap, that means I need more, but until that point, I have enough? Once you start using swap space it's WAY too small. If your db is say 1GB, and you have 10 or so connections running at once, and each might need 20MB of work_mem, then it would be good to at least 2Gig or so so that the db can be cached by the cache and you've got enough memory left over for the db to allocate enough shared_buffers to hold a decent chunk of it (say 256 to 512Meg). OTOH, if your database is 1TB in size, then you can't really have too much memory, as every bit you throw at the machine will help. So, about how big is your db? How many users are likely to be running queries at once? How big of a chunk of data are those users likely to each need for sorts etc? -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general