ID: 12084
Updated by: thies
Status: Open
Bug Type: PostgreSQL related
Operating System: Debian 2.2
PHP Version: 4.0.6
New Comment:

this is not a bug in php. here's the reply from 
Jan Wieck (PostgreSQL core guy) also read

    AFAIK  TIME_WAIT is the status TCP/IP connections 
enter after
    successful close to hold the port number for some  
time  just
    in  case  there  are retransmit packets and the like 
still on
    the wire, so that no other process right now can bind 
to this
    port and gets confused when these orphaned packets 
    Well,  on  this  doesn't  really make 
sense. And I
    think it can be avoided by using SO_REUSE, but I'm  
not  100%
    sure on that.
    OTOH  it's  only a real problem if you open/close 
many, many,
    many (and I really mean many) connections in  a  short 
    These  TIME_WAIT's disappear after a while and they 
don't eat
    bread  in  the  meantime.  So  if  you  don't  run   
out   of
    unprivileged ports, why worry about them?

Previous Comments:

[2001-07-12 02:42:29] [EMAIL PROTECTED]

postgres 7.1.2

I noticed a lot of sockets leaved in TIME_WAIT state in our application. so I worte a 
simple script

for ($i = 0 $i < 100 ; $i++){
    $db = pg_open ("some string");

After that I noticed around 200 sockets in TIME _WAIT state. If I omit the pg_close 
statement averything works fine (and is considerably faster).
The same thing happens if I do a query before reopen a connection.
This bug is not reproducible with postgres 7.0.x

Thanks and goodbye


Edit this bug report at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to