Re: [PERFORM] Memory usage of writer process

2009-08-14 Thread Alex Neth
This is postgres 8.4 BTW.

It says 2.9Gb of RESIDENT memory, that also seems to be shared.  Is
this the writer sharing the records it wrote in a shared buffer?

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
11088 postgres  13  -2 3217m 3.0g 3.0g S0 39.5   0:14.23 postgres:
writer process
  968 postgres  14  -2 3219m 1.4g 1.4g S0 18.8   4:37.57 postgres:
cribq cribq [local] idle
24593 postgres  13  -2 3219m 331m 327m S0  4.3   0:10.12 postgres:
cribq cribq [local] idle
26181 postgres  13  -2 3219m 323m 319m S0  4.2   0:06.48 postgres:
cribq cribq [local] idle
12504 postgres  14  -2 3219m 297m 293m S0  3.9   0:02.71 postgres:
cribq cribq [local] idle
13565 postgres  14  -2 3219m 292m 288m S0  3.8   0:02.75 postgres:
cribq cribq [local] idle
  623 postgres  13  -2 3219m 292m 287m S0  3.8   0:02.28 postgres:
cribq cribq [local] idle


On Thu, Aug 13, 2009 at 1:29 PM, Alvaro
Herreraalvhe...@commandprompt.com wrote:
 Alex wrote:
 The writer process seems to be using inordinate amounts of memory:

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+
 COMMAND
 11088 postgres  13  -2 3217m 2.9g 2.9g S    0 38.7   0:10.46 postgres:
 writer process
 20190 postgres  13  -2 3219m  71m  68m S    0  0.9   0:52.48 postgres:
 cribq cribq [local] idle

 I am writing moderately large (~3k) records to my database a few times
 a second.  Even when I stop doing that, the process continues to take
 up all of that memory.

 Am I reading this right?  Why is it using so much memory?

 shared_buffers?

 --
 Alvaro Herrera                                http://www.CommandPrompt.com/
 The PostgreSQL Company - Command Prompt, Inc.




-- 
Alex Neth
Liivid, Inc
www.liivid.com
+1 206 499 4995
+86 13761577188

Stephen Leacock  - I detest life-insurance agents: they always argue
that I shall some day die, which is not so. -
http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Memory usage of writer process

2009-08-13 Thread Alvaro Herrera
Alex wrote:
 The writer process seems to be using inordinate amounts of memory:
 
   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+
 COMMAND
 11088 postgres  13  -2 3217m 2.9g 2.9g S0 38.7   0:10.46 postgres:
 writer process
 20190 postgres  13  -2 3219m  71m  68m S0  0.9   0:52.48 postgres:
 cribq cribq [local] idle
 
 I am writing moderately large (~3k) records to my database a few times
 a second.  Even when I stop doing that, the process continues to take
 up all of that memory.
 
 Am I reading this right?  Why is it using so much memory?

shared_buffers?

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: [PERFORM] Memory usage of writer process

2009-08-13 Thread Scott Carey



On 8/12/09 9:44 PM, Alex a...@liivid.com wrote:

 The writer process seems to be using inordinate amounts of memory:
 
   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+
 COMMAND
 11088 postgres  13  -2 3217m 2.9g 2.9g S0 38.7   0:10.46 postgres:
 writer process
 20190 postgres  13  -2 3219m  71m  68m S0  0.9   0:52.48 postgres:
 cribq cribq [local] idle
 
 I am writing moderately large (~3k) records to my database a few times
 a second.  Even when I stop doing that, the process continues to take
 up all of that memory.
 
 Am I reading this right?  Why is it using so much memory?
 

It is exclusively using the difference between the RES and SHR columns.  So
... Less than ~50MB and likely much less than that  (2.9g - 2.9g with
rounding error).

SHR is the shared memory the process has touched, and is shared amongst all
postgres processes.  Typically, this maxes out at the value of your
shared_buffers setting.

Based on the above, I'd wager your shared_buffers setting is 3000MB.


If your writer process or any other process has a value for (RES - SHR) that
is very large, then be concerned.   For example, the second postgres process
in the above top output is using about 3MB exclusively, but has touched
about 68MB of the shared space, and so it shows up as 68 + 3 = 71m in the
RES column.  3MB is not much so this is not a concern.


 
 --
 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-performance
 


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance