Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 75E152E2B56 for ; Thu, 15 Nov 2007 10:06:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 52914-03 for ; Thu, 15 Nov 2007 10:06:43 -0400 (AST) Received: from bay0-omc2-s12.bay0.hotmail.com (bay0-omc2-s12.bay0.hotmail.com [65.54.246.148]) by postgresql.org (Postfix) with ESMTP id 1AB172E2DAE for ; Thu, 15 Nov 2007 10:06:44 -0400 (AST) Received: from BAY116-W16 ([64.4.38.116]) by bay0-omc2-s12.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 Nov 2007 06:06:42 -0800 Message-ID: Content-Type: multipart/alternative; boundary="_640ae26c-f296-4e06-8824-21b2215b490b_" X-Originating-IP: [204.132.58.73] From: dx k9 To: Scott Marlowe CC: posgres support Subject: Re: cached memory Date: Thu, 15 Nov 2007 09:06:42 -0500 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 15 Nov 2007 14:06:42.0778 (UTC) FILETIME=[BFDD3BA0:01C82790] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.309 tagged_above=0 required=5 tests=AWL=0.493, BAYES_40=-0.185, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200711/138 X-Sequence-Number: 27381 --_640ae26c-f296-4e06-8824-21b2215b490b_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Scott, =20 Thanks for the reply. =20 Top is showing 10157008 / 15897160 in kernel cache, so postgres is using 37= % right now, following what you are saying. I realize the load isn't peaki= ng right now, but wouldn't it be nice to have some of the indexes cached in= memory? In your case 1868064 / 2000000 or 7 % of your memory is being used by postg= res. That sort of proves my point. Shouldn't postgres use more than 7% of= the memory. Doesn't that seem like 93% isn't being used? =20 =20 ~DjK =20 top - 08:59:38 up 277 days, 23:03, 1 user, load average: 0.63, 0.51, 0.40= Tasks: 101 total, 1 running, 100 sleeping, 0 stopped, 0 zombieCpu0 := 0.0% us, 1.0% sy, 0.0% ni, 99.0% id, 0.0% wa, 0.0% hi, 0.0% siCpu1 = : 0.0% us, 0.0% sy, 0.0% ni, 99.7% id, 0.3% wa, 0.0% hi, 0.0% siCpu2 = : 0.7% us, 0.7% sy, 0.0% ni, 98.3% id, 0.0% wa, 0.0% hi, 0.3% siCpu3= : 0.0% us, 0.0% sy, 0.0% ni, 99.3% id, 0.7% wa, 0.0% hi, 0.0% siMem= : 15897160k total, 10477104k used, 5420056k free, 169780k buffersSwap: = 16779768k total, 78912k used, 16700856k free, 10157008k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1975 p= ostgres 15 0 33412 7932 1388 S 1.0 0.0 1211:09 postgres: stats colle= ctor process 1971 postgres 15 0 1085m 14m 14m S 0.3 0.1 2323:28 /p= ostgres 1 root 16 0 640 80 48 S 0.0 0.0 0:11.55 init [3= ] 2 root RT 0 0 0 0 S 0.0 0.0 0:02.30 [migration/0]= 3 root 34 19 0 0 0 S 0.0 0.0 0:06.99 [ksoftirqd/0] = 4 root RT 0 0 0 0 S 0.0 0.0 0:00.82 [migration/1] = 5 root 34 19 0 0 0 S 0.0 0.0 0:56.60 [ksoftirqd/1] = 6 root RT 0 0 0 0 S 0.0 0.0 0:10.71 [migration/2] = 7 root 34 19 0 0 0 =20 > Date: Wed, 14 Nov 2007 15:20:53 -0600> From: scott.marlowe@gmail.com> To:= bitsandbytes88@hotmail.com> Subject: Re: [ADMIN] cached memory> CC: pgsql-= admin@postgresql.org> > On Nov 14, 2007 3:13 PM, dx k9 wrote:> >> > In looking at some cacti memory usage graphs, the Ora= cle servers show> > only 6 of a total of16 GB of RAM as 'Total Available'. = Whereas, our> > Postgres version 8.24 servers show all 16 GB of RAM totally= available or> > free. Some people are asking why Postgres doesn't take tha= t memory and> > lock into it, so you can't see less 'total available' memor= y. We use a lot> > of B-tree indexes. This may or may not be related, but i= t there a good way> > to make sure those stay in memory?> > Not sure what y= ou mean by totally available. Is the OS using it to> cache? If so, why shou= ld postgresql do what the OS already does so> well.> > Oracle was written b= ack when OSes were barely more than program> loaders and it had to do every= thing, from having its own file systems> to buffering / caching to memory m= anagement to job schedulers.> > PostgreSQL was written as Unix was maturing= (mostly) and takes> advantage of all the cool things a modern unix comes w= ith, and one of> those things is kernel level caching of disk files.> > So,= what does free / top have to say about your memory? And how hard> have the= se servers been working. For instance, my RHEL4 reporting> server, with onl= y 2 Gigs in it shows 1868064 used as kernel cache.> The rest is mostly pgsq= l processes _________________________________________________________________ Help yourself to FREE treats served up daily at the Messenger Caf=E9. Stop = by today. http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=3DTXT_TAGLM_Oc= tWLtagline= --_640ae26c-f296-4e06-8824-21b2215b490b_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Scott,
 
Thanks for the reply.
 
Top is showing 10157008 / 15897160 in kernel cache, so postgres is using&nb= sp;37% right now, following what you are saying.  I realize the load i= sn't peaking right now, but wouldn't it be nice to have some of the indexes= cached in memory?
In your case 1868064 / 2000000 or 7 % of your memory is being used by postg= res.  That sort of proves my point.  Shouldn't postgres use more = than 7% of the memory.  Doesn't that seem like 93% isn't being used?&n= bsp;
 
~DjK
 
top - 08:59:38 up 277 days, 23:03,  1 user,  load average: 0.63, = 0.51, 0.40
Tasks: 101 total,   1 running, 100 sleeping, &= nbsp; 0 stopped,   0 zombie
Cpu0  :  0.0% us,  = 1.0% sy,  0.0% ni, 99.0% id,  0.0% wa,  0.0% hi,  0.0% = si
Cpu1  :  0.0% us,  0.0% sy,  0.0% ni, 99.7% id,&n= bsp; 0.3% wa,  0.0% hi,  0.0% si
Cpu2  :  0.7% us,&n= bsp; 0.7% sy,  0.0% ni, 98.3% id,  0.0% wa,  0.0% hi,  = 0.3% si
Cpu3  :  0.0% us,  0.0% sy,  0.0% ni, 99.3% = id,  0.7% wa,  0.0% hi,  0.0% si
Mem:  15897160k tot= al, 10477104k used,  5420056k free,   169780k buffers
Swa= p: 16779768k total,    78912k used, 16700856k free, 10157008= k cached
  PID USER      PR  NI  VIRT  = RES  SHR S %CPU %MEM    TIME+  COMMAND
 19= 75 postgres  15   0 33412 7932 1388 S  1.0  0.0&nb= sp;  1211:09 postgres: stats collector process
 1971 postgres&= nbsp; 15   0 1085m  14m  14m S  0.3  0.1 = ;  2323:28 /postgres
    1 root   &nb= sp;  16   0   640   80   48 S&= nbsp; 0.0  0.0   0:11.55 init [3]
    2 ro= ot      RT   0     0=     0    0 S  0.0  0.0   = 0:02.30 [migration/0]
    3 root    &= nbsp; 34  19     0    0  =   0 S  0.0  0.0   0:06.99 [ksoftirqd/0]
 &= nbsp;  4 root      RT   0 &nbs= p;   0    0    0 S  0.0  = 0.0   0:00.82 [migration/1]
    5 root &nb= sp;    34  19     0  &nbs= p; 0    0 S  0.0  0.0   0:56.60 [ksoftir= qd/1]
    6 root      RT &n= bsp; 0     0    0    0 S&= nbsp; 0.0  0.0   0:10.71 [migration/2]
   = 7 root      34  19     0=     0    0
 


> Date: Wed, 14 Nov 2007 15:20:53 -0600
> From: scott.marl= owe@gmail.com
> To: bitsandbytes88@hotmail.com
> Subject: Re: [= ADMIN] cached memory
> CC: pgsql-admin@postgresql.org
>
>= ; On Nov 14, 2007 3:13 PM, dx k9 <bitsandbytes88@hotmail.com> wrote:<= BR>> >
> > In looking at some cacti memory usage graphs, the= Oracle servers show
> > only 6 of a total of16 GB of RAM as 'Tota= l Available'. Whereas, our
> > Postgres version 8.24 servers show = all 16 GB of RAM totally available or
> > free. Some people are as= king why Postgres doesn't take that memory and
> > lock into it, s= o you can't see less 'total available' memory. We use a lot
> > of= B-tree indexes. This may or may not be related, but it there a good way> > to make sure those stay in memory?
>
> Not sure wha= t you mean by totally available. Is the OS using it to
> cache? If so= , why should postgresql do what the OS already does so
> well.
>= ;
> Oracle was written back when OSes were barely more than program<= BR>> loaders and it had to do everything, from having its own file syste= ms
> to buffering / caching to memory management to job schedulers.>
> PostgreSQL was written as Unix was maturing (mostly) and ta= kes
> advantage of all the cool things a modern unix comes with, and = one of
> those things is kernel level caching of disk files.
> =
> So, what does free / top have to say about your memory? And how ha= rd
> have these servers been working. For instance, my RHEL4 reportin= g
> server, with only 2 Gigs in it shows 1868064 used as kernel cache= .
> The rest is mostly pgsql processes



Help yourse= lf to FREE treats served up daily at the Messenger Caf=E9. Stop by today! = --_640ae26c-f296-4e06-8824-21b2215b490b_--