Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6503D9FB39D for ; Mon, 13 Nov 2006 19:40:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 13584-03 for ; Mon, 13 Nov 2006 19:40:35 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by postgresql.org (Postfix) with ESMTP id DD7079FB28E for ; Mon, 13 Nov 2006 19:40:34 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so55308nfb for ; Mon, 13 Nov 2006 15:40:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=nWTAN+4swY6NbFpYX8l26jkvSylc4zb4Xm1pCb4a1qxQFftyiJWbdSnwdbSxGgbQAgjTl6sua3bWVNP4MRGr/4aRiWTG2q6ROvREmFESZCTRKMSgrGRr6V8yNvXZTqugkJZmMgoCqwvpt5zFcSNcpBlI6Ak5tpC+NVtHa4rF2ZY= Received: by 10.82.135.13 with SMTP id i13mr29083bud.1163461232929; Mon, 13 Nov 2006 15:40:32 -0800 (PST) Received: by 10.82.173.15 with HTTP; Mon, 13 Nov 2006 15:40:32 -0800 (PST) Message-ID: <1c66bda80611131540r1ea7fc7w4a8fb308cfad4d03@mail.gmail.com> Date: Tue, 14 Nov 2006 12:40:32 +1300 From: adey To: imad Subject: Re: Issue with processes open for clients Cc: "jose fuenmayor" , "Shoaib Mir" , pgsql-admin@postgresql.org In-Reply-To: <1f30b80c0611101320g10ed4256g439cf262dcc34e5d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14811_12794957.1163461232885" References: <69f2062a0611091154t6a345360g165dd0e80495bcb7@mail.gmail.com> <69f2062a0611100509v2ad2c475x30aed66f9610ec66@mail.gmail.com> <69f2062a0611101313p3bbdbc2bm437011fb98de1144@mail.gmail.com> <1f30b80c0611101320g10ed4256g439cf262dcc34e5d@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/128 X-Sequence-Number: 23655 ------=_Part_14811_12794957.1163461232885 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Is there not a parameter in Postgres to timeout idle connections? On 11/11/06, imad wrote: > > I found it on postgresql archives: > http://archives.postgresql.org/pgsql-admin/2004-09/msg00261.php > > This post was by Tom Lane, I hope this is what you want. > > It will time out by itself eventually (order of a couple hours probably > --- it depends on your TCP stack). You can try a SIGINT or SIGTERM. > SIGINT is safe but may or may not cause the backend to quit. SIGTERM > will make it quit, but I'm not prepared to guarantee that SIGTERM won't > have bad side effects. I'd suggest waiting... > > > > --Imad > www.EnterpriseDB.com > > > On 11/11/06, jose fuenmayor wrote: > > Ok but what can i do with that information? > > > > On 11/10/06, Shoaib Mir wrote: > > > Check pg_stat_activity for any queries that are in execution mode, > where > > command_query will give you the query and you will also get the process > ids > > for them in pg_stat_activity. > > > > > > > > > Thanks, > > > ------- > > > Shoaib Mir > > > EnterpriseDB (www.enterprisedb.com) > > > > > > > > > On 11/10/06, jose fuenmayor wrote: > > > > Hi thanks for the answer, but.... > > > > Is not when the query is executed ,is when the user cancells the > query > > or kill the client that he is using when this query has not finished, > then > > the process in the server is not killed still there taking resources, it > > happens with some clients (psql, phpPgAdmin), how can I configurate the > > firewall to elminate idle connections? will this eliminate all > conections > > that are not doing anything?, because in my case the client is killed > but > > the process in the server for that client not and continues taking > > resources. > > > > thanks in advance! > > > > > > > > > > > > > > > > On 11/10/06, Shoaib Mir < shoaibmir@gmail.com> wrote: > > > > > If you don't need the client connection after query has executed > then > > just close that client connection or you can have it set in your > firewall to > > kill such idle connections who are not doing anything. > > > > > > > > > > Thanks, > > > > > -------- > > > > > Shoaib Mir > > > > > EnterpriseDB (www.enterprisedb.com) > > > > > > > > > > > > > > > > > > > > On 11/10/06, jose fuenmayor < jafn82@gmail.com> wrote: > > > > > > Hi all , I have a question or a doubt, when I ran psql remotely > it > > opens a process on the server, so I issue a query (select count(*) from > > 80millionsrowstable) then I can see that process taking cpu and mem from > the > > server (using top), then I cancel the psql on the client, I expect to > see > > that process gone but that is not the case it is still there! and taking > > resources!. > > > > > > > > > > > > When I cancelled the query issued by the client is not supposed > to > > eliminate the process open for him on the server? > > > > > > > > > > > > The process stays hanging there? > > > > > > why is that?. > > > > > > Is there any parameter on postgresql or the operating system > that > > can tune? > > > > > > I am using mandriva linux free 2006 > > > > > > kernel 2.6.12 > > > > > > Postgresql 8.0.8 > > > > > > phpPgAdmin 4.0.1 (running in a web server whit php module 5.0.4) > > > > > > > > > > > > Same thing using phpPgAdmin > > > > > > > > > > > > Thanks in advance! I really aprecciate your help! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > ------=_Part_14811_12794957.1163461232885 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Is there not a parameter in Postgres to timeout idle connections?

On 11/11/06, imad <immaad@gmail.com> wrote:
I found it on postgresql archives:
http://archives.postgresql.org/pgsql-admin/2004-09/msg00261.php

This post was by Tom Lane, I hope this is what you want.

It will time out by itself eventually (order of a couple hours probably
--- it depends on your TCP stack).  You can try a SIGINT or SIGTERM.
SIGINT is safe but may or may not cause the backend to quit.  SIGTERM
will make it quit, but I'm not prepared to guarantee that SIGTERM won't
have bad side effects.  I'd suggest waiting...



--Imad
www.EnterpriseDB.com


On 11/11/06, jose fuenmayor <jafn82@gmail.com> wrote:
> Ok but what can i do with that information?
>
> On 11/10/06, Shoaib Mir <shoaibmir@gmail.com> wrote:
> > Check pg_stat_activity for any queries that are in execution mode, where
> command_query will give you the query and you will also get the process ids
> for them in pg_stat_activity.
> >
> >
> > Thanks,
> > -------
> > Shoaib Mir
> > EnterpriseDB (www.enterprisedb.com)
> >
> >
> > On 11/10/06, jose fuenmayor <jafn82@gmail.com > wrote:
> > > Hi thanks for the answer, but....
> > > Is not when the query is executed ,is when the user cancells the query
> or kill the client that he is using when this query has not finished, then
> the process in the server is not killed still there taking resources, it
> happens with some clients (psql, phpPgAdmin), how can I configurate the
> firewall to elminate idle connections? will this eliminate all conections
> that are not doing anything?, because in my case the client is killed but
> the process in  the server for that client not and continues taking
> resources.
> > > thanks in advance!
> > >
> > >
> > >
> > > On 11/10/06, Shoaib Mir < shoaibmir@gmail.com> wrote:
> > > > If you don't need the client connection after query has executed then
> just close that client connection or you can have it set in your firewall to
> kill such idle connections who are not doing anything.
> > > >
> > > > Thanks,
> > > > --------
> > > > Shoaib Mir
> > > > EnterpriseDB (www.enterprisedb.com)
> > > >
> > > >
> > > >
> > > > On 11/10/06, jose fuenmayor < jafn82@gmail.com> wrote:
> > > > > Hi all , I have a question or a doubt, when I ran psql remotely it
> opens a process on the server, so I issue a query (select count(*) from
> 80millionsrowstable) then I can see that process taking cpu and mem from the
> server (using top), then I cancel the psql on the client, I expect to see
> that process gone but that is not the case it is still there! and taking
> resources!.
> > > > >
> > > > > When I cancelled the query issued by the client is not supposed to
> eliminate the process open for him on the server?
> > > > >
> > > > > The process stays hanging there?
> > > > > why is that?.
> > > > > Is there any parameter on postgresql or the operating system that
> can tune?
> > > > > I am using mandriva linux free 2006
> > > > > kernel 2.6.12
> > > > > Postgresql 8.0.8
> > > > > phpPgAdmin 4.0.1 (running in a web server whit php module 5.0.4)
> > > > >
> > > > > Same thing using phpPgAdmin
> > > > >
> > > > > Thanks in advance! I really aprecciate your help!
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

------=_Part_14811_12794957.1163461232885--