Обсуждение: about memory size reported by system.
Hi everyone! I have a doubt about the memory consumed by each connection open. suddenly my server, running postgres 8.3.11, began to run too slowly. Checking the process with: ps -adelfo pcpu,vsz,args | more The processes,related to the connection to the db, each one have a consume of memory near to the 50Mb. by the way i have50 connections to the db, so i have a reported memory consumed of 2.5M, when i have only 1G in the server. If I modify the shared_buffers value, the report of memory consumed is according with shared buffers value. Should I worry by that? There is a best way to tweak the memory consumed by postgres? -- SENSA Control Digital. Ing. Edmundo Robles Lopez. Analista Programador.
Are you using any connection pooling system, if not look at the pgpool & pgbouncer.
open connections always reserves memory, which slowdown the performance of system.
you can also handle application connections at application level by defining garbage
value if any connection disconnect. It will release the memory reserved by connection.
--
Thanks & Regards
Dhaval Jaiswal
-----Original Message-----
From: pgsql-general-owner@postgresql.org on behalf of Edmundo Robles L.
Sent: Wed 3/9/2011 10:12 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] about memory size reported by system.
Hi everyone!
I have a doubt about the memory consumed by each connection open.
suddenly my server, running postgres 8.3.11, began to run too slowly.
Checking the process with: ps -adelfo pcpu,vsz,args | more
The processes,related to the connection to the db, each one have a consume of memory near to the 50Mb. by the way i have 50 connections to the db, so i have a reported memory consumed of 2.5M, when i have only 1G in the server.
If I modify the shared_buffers value, the report of memory consumed is according with shared buffers value.
Should I worry by that?
There is a best way to tweak the memory consumed by postgres?
--
SENSA Control Digital.
Ing. Edmundo Robles Lopez.
Analista Programador.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon,this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from your computer. Microland takes all reasonable steps to ensure that its electronic communications are free from viruses. However, given Internet accessibility, the Company cannot accept liability for any virus introduced by this e-mail or any attachment and you are advised to use up-to-date virus checking software.
On Wed, Mar 9, 2011 at 9:42 AM, Edmundo Robles L. <erobles@sensacd.com.mx> wrote: > Hi everyone! > > I have a doubt about the memory consumed by each connection open. > > suddenly my server, running postgres 8.3.11, began to run too slowly. > > Checking the process with: ps -adelfo pcpu,vsz,args | more > > The processes,related to the connection to the db, each one have a consume of memory near to the 50Mb. by the way i have50 connections to the db, so i have a reported memory consumed of 2.5M, when i have only 1G in the server. > > If I modify the shared_buffers value, the report of memory consumed is according with shared buffers value. The most likely explanation is that you're misinterpreting the restuls of your ps output. Vsize is virtual size which includes all libs linked whether loaded or not and the amount of shared memory the process is touching. For instance, here's the output of top on my machine running postgres at work: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14037 dgish 20 0 4259m 455m 445m R 98 0.4 31:16.24 postgres 32318 dgish 20 0 4260m 2.0g 1.9g R 98 1.6 0:08.59 postgres 32464 dgish 20 0 4263m 1.4g 1.4g R 91 1.2 0:06.96 postgres 2150 dgish 20 0 4254m 227m 220m S 86 0.2 0:01.94 postgres 866 dgish 20 0 4270m 1.5g 1.4g S 50 1.2 0:08.46 postgres 29930 dgish 20 0 4263m 1.6g 1.6g R 34 1.3 0:15.99 postgres 888 dgish 20 0 4259m 239m 230m S 33 0.2 0:02.01 postgres Note that virt is a tad over 4G. Can you guess what my shared_buffers are set to? Yep, 4G. Each process is aware of all the shared_buffers. Actual resident / in use memory ranges from 455M to 2G, but we subtract the shared memory it's using right now for shared_buffers and we get a delta, which is in the 100Meg or less range. So each individual backend is using < !00Meg (good thing I've got several huindred of them).