pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Accumulating idle processes
2+ messages / 2 participants
[nested] [flat]

* Accumulating idle processes
@ 2005-11-21 06:05 Gary Hoffman <ghoffman@ucsd.edu>
  2005-11-21 09:51 ` Re: Accumulating idle processes Mario Splivalo <mario.splivalo@mobart.hr>
  0 siblings, 1 reply; 2+ messages in thread

From: Gary Hoffman @ 2005-11-21 06:05 UTC (permalink / raw)
  To: pgsql-admin


I've run PHP and PostgreSQL for quite a while and never seen this problem
before. I think it's new, but maybe I never paid attention to it before.

I am frequently running out of connections to the database. Here's a
snippet of my ps -ax

 1882  ??  S      0:00.07 postgres: postgres cgssd_members [local] idle   
    
 1883  ??  S      0:00.09 postgres: postgres cgssd_members [local] idle   
    
 1884  ??  S      0:00.07 postgres: postgres cgssd_members [local] idle   
    
 1886  ??  S      0:00.14 postgres: postgres cgssd_members [local] idle   
    
 1887  ??  S      0:00.06 postgres: postgres cgssd_members [local] idle   
    
  500 std- S      0:01.14 /usr/local/bin/postmaster -D
/usr/local/pgsql/data
  501 std- S      0:00.02 postgres: stats buffer process                  
    
  502 std- S      0:00.21 postgres: stats collector process               
    

As you can see, there are some connections that have come in from PHP on
my web pages and have gone idle. I've never seen these before and
eventually they build up and I get an error connecting from the PHP page
to the database. I can kill -9 one of them, and the other disappear. What
is going on here? Some cleanup process is not working.

I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PHP
4.3.6 and PostgreSQL 7.4.2.

Ideas and suggestions are welcome.

Thanks,
Gary

**************************************************************************
* Gary B. Hoffman, Computing Services Manager  e-mail: ghoffman@ucsd.edu *
* Graduate School of International Relations and Pacific Studies (IR/PS) *
* University of California, San Diego (UCSD)       voice: (858) 534-1989 *
* 9500 Gilman Dr.  MC 0519                           fax: (858) 534-3939 *
* La Jolla, CA 92093-0519 USA                 web: http://irps.ucsd.edu/ *
**************************************************************************







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Accumulating idle processes
  2005-11-21 06:05 Accumulating idle processes Gary Hoffman <ghoffman@ucsd.edu>
@ 2005-11-21 09:51 ` Mario Splivalo <mario.splivalo@mobart.hr>
  0 siblings, 0 replies; 2+ messages in thread

From: Mario Splivalo @ 2005-11-21 09:51 UTC (permalink / raw)
  To: Gary Hoffman <ghoffman@ucsd.edu>; +Cc: pgsql-admin

On Sun, 2005-11-20 at 22:05 -0800, Gary Hoffman wrote:
> I've run PHP and PostgreSQL for quite a while and never seen this problem
> before. I think it's new, but maybe I never paid attention to it before.
> 
> I am frequently running out of connections to the database. Here's a
> snippet of my ps -ax
> 
>  1882  ??  S      0:00.07 postgres: postgres cgssd_members [local] idle   
>     
>  1883  ??  S      0:00.09 postgres: postgres cgssd_members [local] idle   
>     
>  1884  ??  S      0:00.07 postgres: postgres cgssd_members [local] idle   
>     
>  1886  ??  S      0:00.14 postgres: postgres cgssd_members [local] idle   
>     
>  1887  ??  S      0:00.06 postgres: postgres cgssd_members [local] idle   
>     
>   500 std- S      0:01.14 /usr/local/bin/postmaster -D
> /usr/local/pgsql/data
>   501 std- S      0:00.02 postgres: stats buffer process                  
>     
>   502 std- S      0:00.21 postgres: stats collector process               
>     
> 
> As you can see, there are some connections that have come in from PHP on
> my web pages and have gone idle. I've never seen these before and
> eventually they build up and I get an error connecting from the PHP page
> to the database. I can kill -9 one of them, and the other disappear. What
> is going on here? Some cleanup process is not working.
> 
> I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PHP
> 4.3.6 and PostgreSQL 7.4.2.
> 
> Ideas and suggestions are welcome.

Are you absolutley sure you close postgres connection within your PHP
pages? I've experienced very same problem using PHP (i was not using
persistent database connections - those seemed much slower) because I
was missing several 'pg_close()' instructions.

The same thing happened to my developers here, using java/tomcat/jdbc to
connect to postgres. Make sure you close all your postgres connections.

	Mike
-- 
Mario Splivalo
Mob-Art
mario.splivalo@mobart.hr

"I can do it quick, I can do it cheap, I can do it well. Pick any two."





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-11-21 09:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 06:05 Accumulating idle processes Gary Hoffman <ghoffman@ucsd.edu>
2005-11-21 09:51 ` Mario Splivalo <mario.splivalo@mobart.hr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox