Re: Postgre Eating Up Too Much RAM

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: Aaron Bono <aaron(dot)bono(at)aranya(dot)com>
Cc: Postgres <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgre Eating Up Too Much RAM
Date: 2012-11-14 03:02:50
Message-ID: 50A309DA.2040702@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 11/14/2012 06:12 AM, Aaron Bono wrote:

>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> ....
> postgres 3523 0.5 1.0 426076 313156 ? Ss 08:44 2:42 \_
> postgres: myuser my_db 192.168.1.2(39786) idle
>
> postgres 3820 0.4 0.9 418988 302036 ? Ss 09:04 2:11 \_
> postgres: myuser my_db 192.168.1.2(52110) idle
>
> postgres 3821 0.1 0.5 391452 178972 ? Ss 09:04 0:44 \_
> postgres: myuser my_db 192.168.1.2(52111) idle
>
> postgres 3822 0.0 0.0 369572 9928 ? Ss 09:04 0:00 \_
> postgres: myuser my_db 192.168.1.2(52112) idle
>
> postgres 3823 0.2 0.6 383368 202312 ? Ss 09:04 1:12 \_
> postgres: myuser my_db 192.168.1.2(52114) idle
>
> postgres 3824 0.0 0.0 369320 8820 ? Ss 09:04 0:00 \_
> postgres: myuser my_db 192.168.1.2(52115) idle
>
> postgres 3825 0.4 0.8 413964 257040 ? Ss 09:04 1:54 \_
> postgres: myuser my_db 192.168.1.2(52116) idle
>

>
> Am I reading this right? Are there individual connections using over
> 300 MB or RAM by themselves?
If I recall correctly, RSS is charged against a PostgreSQL back-end when
it touches `shared_buffers`. So that doesn't necessarily mean that the
back-end is using the full amount of memory listed as RSS.

Yes, measuring how much memory Pg uses is seriously frustrating because
OS accounting for shared memory is so bad.

See http://www.depesz.com/2012/06/09/how-much-ram-is-postgresql-using/

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2012-11-14 03:19:03 Re: Postgre Eating Up Too Much RAM
Previous Message Aaron Bono 2012-11-13 22:12:07 Postgre Eating Up Too Much RAM