Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f11Qr-0002g9-0C for pgsql-general@arkaria.postgresql.org; Wed, 28 Mar 2018 03:07:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f11Qp-00085D-8q for pgsql-general@arkaria.postgresql.org; Wed, 28 Mar 2018 03:07:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f11Qo-000854-Lx for pgsql-general@lists.postgresql.org; Wed, 28 Mar 2018 03:07:23 +0000 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f11Qh-0000Fh-Oe for pgsql-general@lists.postgresql.org; Wed, 28 Mar 2018 03:07:21 +0000 Received: by mail-io0-x22c.google.com with SMTP id e79so1709258ioi.7 for ; Tue, 27 Mar 2018 20:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VvJ3vGQ06skn+b5iJOtHrLefUf24OYh3vg2ZTY4rDiY=; b=scffqS1pAzAjVNZm4lO7fteXmqDVGqvxl/UmGr/fHFfaepWc1z5m6YdEcqMneHViWh bLQAvQrCSJkDyYWvLhtR6dfB9+2MHBqy3pWkg3Oyxsba+YVAYDzZB4DEdnaTZSPvD+D3 BbIkXr/RG1X8XyQ20twJo+AC3TzKGgZtiqHUKCt7etB13+DjCNG969uem7xDn+Qknt9g RcxnuTUQ8C9i2Cedhl4fFNZhd+HkbXNWk12MR3iwLwXFDMMv36Qz3Y3iDjhxfUd1uwra xi7g6U5PqWUEH0IIMy6Qt8JLq5MipGtNLw7PEzoBGk7REwquc/IeIq/8DaPBRCBq4tLt fODQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VvJ3vGQ06skn+b5iJOtHrLefUf24OYh3vg2ZTY4rDiY=; b=TJbbvuOB5V2qv8X21owo0RVI6oCbYbehL5SyIfgPqGtOfbe4JpRFhdNfKiWZGoAA8x g+3miNm4S4HVIAHrXdQ3iPZXtXkpTSHW56Rd16WA4kb4NQNLRrSI7UElJiorOwTlCqki +20irhdl/lW0o2sC7g16AmA0YZL1F/a4Uv8jh+XpESiG4eqMHozTyB+zonUOnaJvx7Hf LNcZYGq0VnlaTuigp6+WKrYRBo5jVUTkIpRd3TYoHPa1t+usx22qO2/hDdpf4pMOXStp 9Pei/RRlosIYQ9CaNBT7rT4HdcME/WjhzUHxysK6nzdiCQ9BBTgAygpECTriS/oW8z30 gKbQ== X-Gm-Message-State: AElRT7EynLqEadhVWzrALFj86FGC0e/JUrnakUZ8BnHd4GLnlaBGa+1s 45GwKgRtOTV8Oui9e8Jijdmht7/I X-Google-Smtp-Source: AG47ELupnQOSl/2/wNv7+PfNMtqEsIcnX0k0nv4J3nVJQRRVir8Cl6BjBel+HkhufUTnkhuJliQ9bw== X-Received: by 10.107.136.131 with SMTP id s3mr45965779ioi.177.1522206434282; Tue, 27 Mar 2018 20:07:14 -0700 (PDT) Received: from ?IPv6:2605:a601:2062:d00:94d:a3ea:e9de:15d8? ([2605:a601:2062:d00:94d:a3ea:e9de:15d8]) by smtp.gmail.com with ESMTPSA id y23-v6sm1903607itc.6.2018.03.27.20.07.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 20:07:13 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-0BAC22A8-E314-4631-B9E1-28793802D882 Mime-Version: 1.0 (1.0) Subject: Re: connection dropped from the backend server From: armand pirvu X-Mailer: iPhone Mail (14G60) In-Reply-To: <39D1AF67-3501-48C5-B143-D9F50F28F1E2@gmail.com> Date: Tue, 27 Mar 2018 22:07:12 -0500 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: <70F4952C-B0EA-4DDC-AACD-3CFBDA8425DD@gmail.com> References: <88B8EEC2-917D-498D-938B-DD4C2C3C7008@gmail.com> <9c4890fe-df61-eae9-48c0-f01fbafedf3a@aklaver.com> <5FCACAED-139A-4D38-80AA-895C5884631E@gmail.com> <0b0e0503-0e34-32cd-50a7-9be77601a2a5@aklaver.com> <6164.1522194582@sss.pgh.pa.us> <39D1AF67-3501-48C5-B143-D9F50F28F1E2@gmail.com> To: Tom Lane , Adrian Klaver List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-0BAC22A8-E314-4631-B9E1-28793802D882 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sent from my iPhone > On Mar 27, 2018, at 9:21 PM, armand pirvu wrote: >=20 >=20 >>> On Mar 27, 2018, at 6:49 PM, Tom Lane wrote: >>>=20 >>> Adrian Klaver writes: >>>> On 03/27/2018 04:07 PM, armand pirvu wrote: >>>> As long as the connection stays up yes data gets fine across >>>> In pg_stat_activity I see the node ip address where tail -f piped into p= sql happens >>=20 >>> So what does the rest of that record show? In particular for: >>=20 >> I wonder how often data gets put into the pipe. If it's "not very often"= , >> maybe the connection from psql to the server is timing out due to >> inactivity? This would be the fault of a firewall or something in >> between. You could probably fix it by enabling (more aggressive) TCP >> keepalive settings. >>=20 >> regards, tom lane >=20 > Well there is no flow pattern, The flow can be inexistent for days , even w= eeks and then it can get super busy >=20 > The data flows as expected well untill the connection gets dropped. Bolded= from pg_stat_activity (a test I just did) >=20 > birstdb=3D# select datname, pid, client_addr, client_port, backend_start, q= uery_start, state from pg_stat_Activity; > datname | pid | client_addr | client_port | backend_start = | query_start | state =20 > ---------+-------+---------------+-------------+--------------------------= -----+-------------------------------+-------- > birstdb | 10046 | | -1 | 2018-03-27 20:40:11.72180= 4-05 | 2018-03-27 20:47:27.118434-05 | active > birstdb | 10082 | 192.168.1.187 | 55859 | 2018-03-27 20:43:55.30121= 6-05 | 2018-03-27 20:46:07.190064-05 | idle >=20 >=20 > ps -fu armandp > UID PID PPID C STIME TTY TIME CMD > armandp 3264 3263 0 20:39:13 pts/2 0:00 tail -f /u1/sys_admin/d= ba/ingres2birst.fifo > armandp 3265 3263 0 20:39:13 pts/2 0:00 psql -U csidba -d birst= db -h 172.16.10.93 >=20 >=20 >=20 > Give it about 10 min at most and bam out it goes >=20 > birstdb=3D# select datname, pid, client_addr, client_port, backend_start, q= uery_start, state from pg_stat_Activity; > datname | pid | client_addr | client_port | backend_start = | query_start | state =20 > ---------+-------+-------------+-------------+----------------------------= ---+-------------------------------+-------- > birstdb | 10208 | | -1 | 2018-03-27 20:51:25.835382-= 05 | 2018-03-27 21:08:47.164249-05 | active >=20 > Although the above two processes are still out=20 >=20 > I think the tcp keep alives might help but I am also thinking like a each m= in check maybe and if things got in the pipe well dump =E2=80=98em to Postgr= es. Something along these lines >=20 > Any ideas/suggestions you might have to improve this ? I am not saying it i= s perfect far from it, but I kinda took the model/idea from the Nagios named= pipe only that one too runs at x seconds/minutes interval defined >=20 >=20 >=20 > Thank you both > =E2=80=94 Armand Sorry for the double post but as a possible solution. Why not move the named= pipe to the postgres host and simply whatever i was dumping into said pipe i= nstead of doing locally just doing over ssh What do you think ? Thank you -- Armand= --Apple-Mail-0BAC22A8-E314-4631-B9E1-28793802D882 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


Sent from my iPhone
=
On Mar 27, 2018, at 9:21 PM, armand pirvu <armand.pirvu@gmail.com> wrote:


<= div class=3D"">On Mar 27, 2018, at 6:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Adrian Klaver= <adrian.klaver@a= klaver.com> writes:
On 03/27/2018 04:07 PM, armand pirvu wrote:
As long as the connection stays up yes data gets fine a= cross
In pg_stat_activity I see the node ip address where tail= -f piped into psql happens

So what does the rest of that re= cord show? In particular for:

I wo= nder how often data gets put into the pipe.  If it's "not very often",<= br class=3D"">maybe the connection from psql to the server is timing out due= to
inactivity?  This would be the fault of a firewall or= something in
between.  You could probably fix it by enab= ling (more aggressive) TCP
keepalive settings.
<= br class=3D""> regards, tom= lane

Well there is no flow pattern, The flow can be inexistent for days , e= ven weeks and then it can get super busy

The data flows as expected well untill the connection= gets dropped. Bolded from pg_stat_activity (a test I just did)

birstdb=3D# se= lect datname, pid, client_addr, client_port, backend_start, query_start, sta= te from pg_stat_Activity;
 datname |  pid &nb= sp;|  client_addr  | client_port |         bac= kend_start         |          q= uery_start          | state  
---------+-------+---------------+-------------+-------------------------= ------+-------------------------------+--------
 b= irstdb | 10046 |               |   &= nbsp;      -1 | 2018-03-27 20:40:11.721804-05 | 2018-03-27 20= :47:27.118434-05 | active
 birstdb |= 10082 | 192.168.1.187 |       55859 | 2018-03-27 20:43:55.30= 1216-05 | 2018-03-27 20:46:07.190064-05 | idle


<= div class=3D"">ps -fu armandp
     UID &= nbsp; PID  PPID   C    STIME TTY       &n= bsp; TIME CMD
 armandp  3264  3263  = ; 0 20:39:13 pts/2       0:00 tail -f /u1/sys_admin/dba/ingre= s2birst.fifo
 armandp  3265  3263  = 0 20:39:13 pts/2       0:00 psql -U csidba -d birstdb -h 172= .16.10.93


Give= it about 10 min at most and  bam out it goes

birstdb=3D# select datname, p= id, client_addr, client_port, backend_start, query_start, state from pg_stat= _Activity;
 datname |  pid  | client_add= r | client_port |         backend_start     &n= bsp;   |          query_start     &n= bsp;    | state  
---------+-------+----= ---------+-------------+-------------------------------+--------------------= -----------+--------
 birstdb | 10208 |   &nb= sp;         |          -1 | 201= 8-03-27 20:51:25.835382-05 | 2018-03-27 21:08:47.164249-05 | active

Although the above t= wo processes are still out 

<= div class=3D"">I think the tcp keep alives might help but I am also thinking= like a each min check maybe and if things got in the pipe well dump =E2=80=98= em to Postgres. Something along these lines

Any ideas/suggestions you might have to improve thi= s ? I am not saying it is perfect far from it, but I kinda took the model/id= ea from the Nagios named pipe only that one too runs at x seconds/minutes in= terval defined


Thank= you both
=E2=80=94 Armand

=

Sorry for the double post but as a possible solution. Wh= y not move the named pipe to the postgres host and simply whatever i was dum= ping into said pipe instead of doing locally just doing over ssh
<= br>
What do you think ?


Th= ank you
-- Armand
= --Apple-Mail-0BAC22A8-E314-4631-B9E1-28793802D882--