Re: [GENERAL] Controlling memory of session

2007-01-18 Thread Martijn van Oosterhout
On Thu, Jan 18, 2007 at 11:52:12AM +0100, Magnus Hagander wrote: > > Not knowing how much RAM can take the server is annoying. You have to be > > extra careful and scale the server down as you don't know what will happen. > > The fact that work_mem is "per sort" and not "per backend" is going to >

Re: [GENERAL] Controlling memory of session

2007-01-18 Thread Magnus Hagander
On Thu, Jan 18, 2007 at 07:41:27AM +, James Im wrote: > Ok so the solution is to limit the number of connections. But it seems > that there is no good way to choose the ideal number of connections as I > don't know how much RAM will a connection use. > > If a connection takes 3MB (on windows I

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread James Im
Ok so the solution is to limit the number of connections. But it seems that there is no good way to choose the ideal number of connections as I don't know how much RAM will a connection use. If a connection takes 3MB (on windows I see the process in the Process Monitor, in Linux the RSS is more l

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread Jeff Davis
On Wed, 2007-01-17 at 11:02 +, James Im wrote: > Hi, > > I'm using Postgresql 8.1 on windows2000 and I have a hard time > understanding how to limit the memory of the sessions to 1 MB. > > What I have right now is that each connection (opened with jdbc) takes > about 3MB (some take a little m

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread Richard Huxton
James Im wrote: Richard Huxton wrote: > Is there a particular problem you're trying to solve? yes I'm trying to know how many connections can open to the database without running out of memory. Ideally I would like to optimize stuff so that I can open the maximum number of connection/session.

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread James Im
Richard Huxton wrote: > Is there a particular problem you're trying to solve? yes I'm trying to know how many connections can open to the database without running out of memory. Ideally I would like to optimize stuff so that I can open the maximum number of connection/session. In total I can gi

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread Tom Lane
Richard Huxton writes: > James Im wrote: >> What am I missing to limit the memory taken by session to 1MB? > You can't. In particular, work_mem is memory *per sort* so can be > several times that. If you're trying to get PG to run in 64MB or > something like that, I think you're going to be dis

Re: [GENERAL] Controlling memory of session

2007-01-17 Thread Richard Huxton
James Im wrote: Hi, I'm using Postgresql 8.1 on windows2000 and I have a hard time understanding how to limit the memory of the sessions to 1 MB. Well, you don't explicitly, but see below. What I have right now is that each connection (opened with jdbc) takes about 3MB (some take a little mo

[GENERAL] Controlling memory of session

2007-01-17 Thread James Im
Hi, I'm using Postgresql 8.1 on windows2000 and I have a hard time understanding how to limit the memory of the sessions to 1 MB. What I have right now is that each connection (opened with jdbc) takes about 3MB (some take a little more, some a little less). I think that this is a waste of memory