Hanging queries and I/O exceptions - Mailing list pgsql-performance

From Jan de Visser
Subject Hanging queries and I/O exceptions
Date
Msg-id 200603060938.00751.jdevisser@digitalfairway.com
Whole thread Raw
Responses Re: Hanging queries on dual CPU windows  (Jan de Visser <jdevisser@digitalfairway.com>)
List pgsql-performance
Hello,

While doing performance tests on Windows Server 2003 we observed to following
two problems.

Environment: J2EE application running in JBoss application server, against
pgsql 8.1 database. Load is caused by a smallish number of (very) complex
transactions, typically about 5-10 concurrently.

The first one, which bothers me the most, is that after about 6-8 hours the
application stops processing. No errors are reported, neither by the JDBC
driver nor by the server, but when I kill the application server, I see that
all my connections hang in a SQL statements (which never seem to return):

2006-03-03 08:17:12 4504 6632560 LOG:  duration: 45087000.000 ms  statement:
EXECUTE <unnamed>  [PREPARE:  SELECT objID FROM objects WHERE objID = $1 FOR
UPDATE]

I think I can reliably reproduce this by loading the app, and waiting a couple
of hours.



The second problem is less predictable:

JDBC exception:

An I/O error occured while sending to the backend.
org.postgresql.util.PSQLException: An I/O error occured while sending to the
backend.
        at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:214)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346)
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:250)


In my server log, I have:

2006-03-02 12:31:02 5692 6436342 LOG:  could not receive data from client: A
non-blocking socket operation could not be completed immediately.

At the time my box is fairly heavy loaded, but still responsive. Server and
JBoss appserver live on the same dual 2Ghz Opteron.

A quick Google told me that:

1. More people have seen this.
2. No solutions.
3. The server message appears to indicate an unhandled WSAEWOULDBLOCK winsock
error on recv(), which MSDN said is to be expected and should be retried.

Is this a known bug?

jan


--
--------------------------------------------------------------
Jan de Visser                     jdevisser@digitalfairway.com

                Baruk Khazad! Khazad ai-menu!
--------------------------------------------------------------

pgsql-performance by date:

Previous
From: "Neil Saunders"
Date:
Subject: Re: t1000/t2000 sun-servers
Next
From: "Matthew Nuzum"
Date:
Subject: Re: Postgres on VPS - how much is enough?