Re: Memory Leak executing small queries without closing the connection - FreeBSD

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Memory Leak executing small queries without closing the connection - FreeBSD
Date: 2015-12-14 14:51:49
Message-ID: 566ED785.9020208@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/13/2015 01:23 PM, Gerhard Wiesinger wrote:
> On 13.12.2015 21:14, Bill Moran wrote:
>> Wait ... this is a combined HTTP/Postgres server? You didn't mention that
>> earlier, and it's kind of important.
>>
>> What evidence do you have that Postgres is actually the part of
>> this system running out of memory?
>
> For me the complete picture doesn't look consistent.
>
>> I don't see any such evidence in any of
>> your emails, and (based on experience) I find it pretty likely that
>> whatever
>> is running under node is doing something in a horrifically
>> memory-inefficient
>> manner. Since you mention that you see nothing in the PG logs, that
>> makes it
>> even more likely (to me) that you're looking entirely in the wrong place.
>>
>> I'd be willing to bet a steak dinner that if you put the web server on a
>> different server than the DB, that the memory problems would follow the
>> web server and not the DB server.
>
> Changes in config:
> track_activity_query_size = 102400
> work_mem = 100MB
>
> Ok, we restarted PostgreSQL and had it stopped for seconds, and logged
> top every second:
>
> When PostgreSQL was down nearly all memory was freed, looks good to me.
> So it is likely that node and other processes are not the cause.
> Mem: 742M Active, 358M Inact, 1420M Wired, 21G Cache, 871M Buf, 8110M Free
> Swap: 512M Total, 477M Used, 35M Free, 93% Inuse
>
> When PostgreSQL restarted, Inactive was growing fast (~1min):
> Mem: 7998M Active, 18G Inact, 2763M Wired, 1766M Cache, 1889M Buf, 1041M
> Free
> Swap: 512M Total, 472M Used, 41M Free, 92% Inuse
>
> After some few minutes we are back again at the same situation:
> Mem: 8073M Active, 20G Inact, 2527M Wired, 817M Cache, 1677M Buf, 268M Free
> Swap: 512M Total, 472M Used, 41M Free, 92% Inuse
>
> The steak dinner is mine :-) Donating to the PostgreSQL community :-)

To me all the above proves is that this a complete system issue and only
with all the parts running do you get a problem. It still does indicate
which part or interaction of parts is the issue. This is further muddied
by no description of what, if anything, you where doing in the above
scenarios.

>
> Any further ideas, I don't think this is normal system behaviour.
>
> Ciao,
> Gerhard
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gene Poole 2015-12-14 15:52:41 Practical Application
Previous Message Vladimir Sitnikov 2015-12-14 14:36:21 Re: [GENERAL] plpgsql function with RETURNS SETOF refcursor in JAVA