Re: Server goes to Recovery Mode when run a SQL - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Server goes to Recovery Mode when run a SQL
Date
Msg-id 4f05eb46-78d3-7262-1ebd-c12d4e696daf@aklaver.com
Whole thread Raw
In response to Re: Server goes to Recovery Mode when run a SQL  (PegoraroF10 <marcos@f10.com.br>)
List pgsql-general
On 2/8/19 1:11 PM, PegoraroF10 wrote:
> *Well, now we have two queries which stops completelly our postgres server.
> That problem occurs on 10.6 and 11.1 versions.
> On both server the problem is the same. *

> *Linux Log of new crash, which takes several minutes to stop:*
> 
> Feb  8 15:06:40 fxReplicationServer kernel: [1363901.643121] postgres invoked oom-killer: gfp_mask=0x24280ca,
order=0,oom_score_adj=0
 

So the oom-killer kicked in.

See below for some ways to deal with this:

https://www.postgresql.org/docs/10/kernel-resources.html



> *And this new query which stops the server too but differently because 
> the old one stops immediatelly instead of this, as you can see images.*
> 
> *This query runs for aproximately 5 minutes. See link above with images 
> and logs and you´ll see how memory will grow. Memory use starts with 8gb 
> e grows until use them all. When all memory is in use then it starts to 
> swap. When all swap is allocated then it gets the "out of memory" and 
> stops completelly. You'll see that this query has generate_series, with, 
> recursive and lateral statements. It was bad written because that 
> generate_series generates a enormous quantity of records, probably 
> millions of them. But a wrong query couldn´t stop the entire server, 
> could ?*

You run anything(computer related or otherwise) out of resources and bad 
things are going to happen.



-- 
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Jeremiah Bauer
Date:
Subject: Re: [EXTERNAL]Re: Server goes to Recovery Mode when run a SQL
Next
From: Alexander Reichstadt
Date:
Subject: Trigger function always logs postgres as user name