Re: Calculating memory allocaiton per process

Lists: pgsql-general
From: David Kerr <dmk(at)mr-paradox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Calculating memory allocaiton per process
Date: 2011-04-14 18:31:05
Message-ID: 20110414183105.GB33793@mr-paradox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Howdy,

Is there a doc somewhere that has a formula for how much memory PG backend process will use?

I'm looking to get something like total_mem = max_connections * ( work_mem + temp_buffers )
// I know it's more complicated than that, which is why I'm asking =)

Something similar to Table 17-2 here: http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html
would be awesome.

Dave


From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: David Kerr <dmk(at)mr-paradox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Calculating memory allocaiton per process
Date: 2011-04-14 19:00:07
Message-ID: 87zknsek08.fsf@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

David Kerr <dmk(at)mr-paradox(dot)net> writes:

> Howdy,
>
> Is there a doc somewhere that has a formula for how much memory PG
> backend process will use?
>
> I'm looking to get something like total_mem = max_connections * (
> work_mem + temp_buffers ) // I know it's more complicated than that,
> which is why I'm asking =)

Depends on your query complexity, load distribution across concurrent
sessions and session lifetime.

work_mem will, in cases of queries having multiple sort nodes, have to
be counted multiple times on behalf of a single backend.

Some observation of the running system can be your best bet.

HTH

> Something similar to Table 17-2 here:
> http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html
> would be awesome.
>
> Dave

--
Jerry Sievers
Postgres DBA/Development Consulting
e: gsievers19(at)comcast(dot)net
p: 305.321.1144


From: David Kerr <dmk(at)mr-paradox(dot)net>
To: Jerry Sievers <gsievers19(at)comcast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Calculating memory allocaiton per process
Date: 2011-04-14 19:36:57
Message-ID: 20110414193657.GA36322@mr-paradox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Apr 14, 2011 at 03:00:07PM -0400, Jerry Sievers wrote:
- David Kerr <dmk(at)mr-paradox(dot)net> writes:
-
- > Howdy,
- >
- > Is there a doc somewhere that has a formula for how much memory PG
- > backend process will use?
- >
- > I'm looking to get something like total_mem = max_connections * (
- > work_mem + temp_buffers ) // I know it's more complicated than that,
- > which is why I'm asking =)
-
- Depends on your query complexity, load distribution across concurrent
- sessions and session lifetime.
-
- work_mem will, in cases of queries having multiple sort nodes, have to
- be counted multiple times on behalf of a single backend.
-
- Some observation of the running system can be your best bet.
-
- HTH

Yeah, that's the complication that I knew about (but am still not able to
fully 'get', let along vocalize).

Are there no rules of thumb or upper bounds to help estimate total memory usage?

Thanks

Dave