connection in TIME_WAIT with pqxx
Hi there,
I am using pqxx in a multi-threaded server that connects to a PostgreSQL database. I'm experiencing a problem in which my server leaves a bunch of TIME_WAIT socket connection with the PostgreSQL server when it is running.
When I run 'netstat -tcp' I see literally hundreds of connections from my server to PgSQL in TIME_WAIT state (see below), even after a short period of server activity:
tcp 0 0 localhost:38727 localhost:5432 TIME_WAIT
...
I'm using pqxx's lazyconnection. Actually there is only ONE client running in a loop sending
transactions to the server (via tcp socket), which in turn connects to the PgSQL
database via a lazyconnection (I tried with the usual connection object too).
I guess this is an effect of poor networking programming (socket programming) and/or poor pqxx programming.
Whatever, What should I do to realize this is not a problem related with misusing of pqxx? I mean, I want to be sure I am using pqxx in the right fashion to ensure this problem is not caused by pqxx.
Thanks for your help,
-Ron
_______________________________________________ Libpqxx-general mailing list Libpqxx-general@... http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Jeroen
RSS Feed