Re: Is there any problem with pg_notify and memory consumption?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Per-Olov Esgard <Per-Olov(dot)Esgard(at)micronic-mydata(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there any problem with pg_notify and memory consumption?
Date: 2011-05-26 13:48:05
Message-ID: BANLkTi=9Eu41cb4r25DBF2=SciA8UoELuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 26, 2011 at 7:26 AM, Per-Olov Esgard
<Per-Olov(dot)Esgard(at)micronic-mydata(dot)com> wrote:
> In my environment  which is linux on the server side and both windows and
> linux on the client side I have noticed that the introduction of pg_notify
> (with payload) makes the size of the postgres processes on the server side
> increase much more than before I used the notifiy calls. My server interface
> is a pure psm interface and I use the pg_notify inside my psm:s.
>
> I understand that a server process connected to a client which is listening
> for notifies must in some way store the data sent before it is consumed by
> the client. By my problem is that my linux clients don't listen for any
> notifications. And still the corresponding postgres process on the server
> side seems to grow out of control (checked with ps axuw  %MEM column).
>
> This is currently a big problem for me since my linux application is an
> embedded application with very limited resources.
>
> And yes. I must have the notfify functionality since I'm using it from my
> Windows clients.
>
> My postgres version is  9.04
>
> Is this behaviour to be expected or is there a memory problem in this area?
>
>
> Any idea anyone?

Need more details as Tom noted (especially, how big is the payload?).
Assuming there is not any obvious solvable problem relating to memory
consumption, have you considered using payloadless notify? A typical
way to do that is to, after having received a notification, call back
to the database with something like a session_id and pull back the
payload with a query or a function.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-05-26 13:48:44 Re: max_connections proposal
Previous Message Tom Lane 2011-05-26 13:39:28 Re: Is there any problem with pg_notify and memory consumption?