Thread: idle processes
'ps axu' shows: postgres 1249 0.0 0.7 20200 7296 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle postgres 1251 0.0 0.6 20196 7036 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle postgres 1264 0.0 0.3 19936 3200 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle postgres 1267 0.0 0.2 19936 2992 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle postgres 1274 0.0 0.2 19936 2996 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle postgres 1275 0.0 0.2 19936 3000 ? S 11:50 0:00 postgres: user1 database1 127.0.0.1 idle Any idea why these processes are hanging around (for about 20 minutes)? There's not any other query hogging that database. Will they eventually timeout? (PostgreSQL) 7.4.1 __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
On Saturday 14 August 2004 01:01 pm, CSN wrote: > 'ps axu' shows: > > postgres 1249 0.0 0.7 20200 7296 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1251 0.0 0.6 20196 7036 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1264 0.0 0.3 19936 3200 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1267 0.0 0.2 19936 2992 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1274 0.0 0.2 19936 2996 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1275 0.0 0.2 19936 3000 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > > Any idea why these processes are hanging around (for > about 20 minutes)? There's not any other query hogging > that database. Will they eventually timeout? > Are you using persistant connections? For example, with PHP are you using pg_pconnect instead of pg_connect? -- Robert C. Paulsen, Jr. robert@paulsenonline.net
I'm using regular pg_connect's. The processes eventually went away - was just wondering why they'd stick around. CSN On Saturday 14 August 2004 01:01 pm, CSN wrote: > 'ps axu' shows: > > postgres 1249 0.0 0.7 20200 7296 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1251 0.0 0.6 20196 7036 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1264 0.0 0.3 19936 3200 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1267 0.0 0.2 19936 2992 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1274 0.0 0.2 19936 2996 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > postgres 1275 0.0 0.2 19936 3000 ? S > 11:50 0:00 postgres: user1 database1 127.0.0.1 idle > > Any idea why these processes are hanging around (for > about 20 minutes)? There's not any other query hogging > that database. Will they eventually timeout? > Are you using persistant connections? For example, with PHP are you using pg_pconnect instead of pg_connect? -- Robert C. Paulsen, Jr. robert@paulsenonline.net _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com
On Saturday 14 August 2004 11:17 pm, CSN wrote: > I'm using regular pg_connect's. The processes > eventually went away - was just wondering why they'd > stick around. > Well, unless I misunderstand, when a script ends the connection should go away and I think that means the postgres process supporting it should also go away. Is it possible your script is not ending or is in some kind of loop? I asked about persistent connections because I believe they are supposed to hang around after the script ends and because I noticed the behavior you mentioned ("extraneous" postgres processes) while experimenting with them. With regular non-persistent connections I don't see those long-lived processes. (Aside from the point of your question, it seems to me persistent are somewhat useless since you can't close them when you are done with them.) -- Robert C. Paulsen, Jr. robert@paulsenonline.net
> Date: Sat, 14 Aug 2004 23:43:39 -0500 > From: Robert Paulsen <robert@paulsenonline.net> > To: pgsql-general@postgresql.org > Subject: Re: idle processes > Message-ID: <200408142343.39360.robert@paulsenonline.net> > > On Saturday 14 August 2004 11:17 pm, CSN wrote: > > I'm using regular pg_connect's. The processes > > eventually went away - was just wondering why they'd > > stick around. > > > > Well, unless I misunderstand, when a script ends the connection should go away > and I think that means the postgres process supporting it should also go > away. Is it possible your script is not ending or is in some kind of loop? > > I asked about persistent connections because I believe they are supposed to > hang around after the script ends and because I noticed the behavior you > mentioned ("extraneous" postgres processes) while experimenting with them. > With regular non-persistent connections I don't see those long-lived > processes. > > (Aside from the point of your question, it seems to me persistent are somewhat > useless since you can't close them when you are done with them.) > > -- > Robert C. Paulsen, Jr. > robert@paulsenonline.net The scripts don't appear to be hanging around. The only other time I've seen idle processes back up was when another query on the same table was taking a long time (don't know why they'd back up either since postgres doesn't use table locking like mysql). But that wasn't happening in this case. I'm just curious about this behavior - it doesn't appear to be causing any significant problems in this case. CSN __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail