Re: Connection Drop from PostgreSQL Database Server

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Mohit Kumar Sahni <Mohit(dot)Sahni(at)india(dot)nec(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Cc: Maneesh Kumar Singh <maneesh(dot)singh(at)india(dot)nec(dot)com>
Subject: Re: Connection Drop from PostgreSQL Database Server
Date: 2019-03-06 05:09:11
Message-ID: a017e405-ba14-d4b9-8d35-769425643cc3@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/5/19 7:13 PM, Mohit Kumar Sahni wrote:
> Hi Adrian,
>
> I have checked my log files. Here are some of the lines that I think were logged at the time of connection drop:
> 2019-03-03 15:57:33.444 UTC [7146] azpostgres(at)master_configuration_db LOG: could not receive data from client: Connection timed out
> 2019-03-03 15:57:33.444 UTC [13161] azpostgres(at)master_configuration_db LOG: could not receive data from client: Connection timed out
> 2019-03-03 15:57:33.444 UTC [7571] azpostgres(at)master_configuration_db LOG: could not receive data from client: Connection timed out
> 2019-03-03 15:57:33.446 UTC [14459] azpostgres(at)master_configuration_db LOG: could not receive data from client: Connection timed out
> 2019-03-03 15:57:33.448 UTC [18010] azpostgres(at)postgres LOG: could not receive data from client: Connection timed out

Where is the client running relative to the server?

Does Azure Cloud have a timeout set for connections?

>
> And for the parameters, I have tried following values:
> 1. tcp_keepalive_idle: 10000 & 2700
> 2. tcp_keepalive_interval: 10000 & 2600
> 3. tcp_keepalive_count: 0 & 1
> 4. session_timeout: 20000
>
> All the values couldn't solve the problem.
>
> Thanks
> Mohit Kumar Sahni
>
> ________________________________________
> From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
> Sent: Wednesday, March 6, 2019 6:19 AM
> To: Mohit Kumar Sahni; pgsql-general(at)lists(dot)postgresql(dot)org
> Cc: Maneesh Kumar Singh
> Subject: Re: Connection Drop from PostgreSQL Database Server
>
> On 3/5/19 4:19 AM, Mohit Kumar Sahni wrote:
>> I have done a setup over Azure Cloud for my PostgreSQL DB.
>> It's Ubuntu 18.04 LTS (4vCPU, 8GB RAM) machine with PostgreSQL 9.6 version.
>> The problem that occurring is, when the connection to the postgresql db stays idle for some time let's say 2 to 10 minutes then the connection to the db does not respond such that it doesn't fulfil the request and keep processing the query.
>> Same goes with my JAVA Springboot Application. The connection doesn't respond and the query keep processing.
>
> Is there anything in the Postgres log that is relevant?
>
> The same for the OS system log?
>
>>
>> This happens randomly such that the timing is not traceable sometimes it happens in 2 minutes, sometimes in 10 minutes & sometimes don't.
>> I have tried with PostgreSQL Configuration file parameters. I have tried:
>> tcp_keepalive_idle, tcp_keepalive_interval, tcp_keepalive_count.
>> Also statement_timeout & session_timeout parameters but it doesn't change anyway.
>
> What values for the above?
>
>>
>> Thank you
>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2019-03-06 05:16:27 Re: write on standby
Previous Message Adrian Klaver 2019-03-06 05:06:59 Re: How to make PAF use psql to login with password