Re: Postgre Eating Up Too Much RAM - Mailing list pgsql-admin

From Craig Ringer
Subject Re: Postgre Eating Up Too Much RAM
Date
Msg-id 50A309DA.2040702@2ndQuadrant.com
Whole thread Raw
In response to Postgre Eating Up Too Much RAM  (Aaron Bono <aaron.bono@aranya.com>)
Responses Re: Postgre Eating Up Too Much RAM
List 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

pgsql-admin by date:

Previous
From: Aaron Bono
Date:
Subject: Postgre Eating Up Too Much RAM
Next
From: Tom Lane
Date:
Subject: Re: Postgre Eating Up Too Much RAM