Thread: JDBC Driver under load

JDBC Driver under load

From
"Mike Cannon-Brookes"
Date:
Has anyone used the JDBC driver under heavy load?

We're having a problem on one of our production machines that on some
occasions under heavy load Postgres JDBC connections seem to be dying /
locking up. Here's an example trace:

An I/O error occured while reading from backend - Exception:
java.net.SocketException: Connection reset by peer: Connection reset by peer
Stack Trace:
java.net.SocketException: Connection reset by peer: Connection reset by peer
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:86)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
        at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:181)
        at org.postgresql.Connection.openConnection(Connection.java:160)
        at org.postgresql.Driver.connect(Driver.java:122)

or

An I/O error occured while reading from backend - Exception:
java.net.SocketException: Broken pipe: Broken pipe
Stack Trace:
java.net.SocketException: Broken pipe: Broken pipe
        at java.net.SocketInputStream.socketRead(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:86)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
        at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:181)
        at org.postgresql.Connection.openConnection(Connection.java:160)
        at org.postgresql.Driver.connect(Driver.java:122)
...
        at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:184)
        at org.postgresql.Connection.openConnection(Connection.java:160)
        at org.postgresql.Driver.connect(Driver.java:122)

any ideas where to start looking?

-mike



Re: JDBC Driver under load

From
Tom Lane
Date:
What shows up in the postmaster's log when this happens?

(If you're not keeping a postmaster log, now would be a good time
to start.)

            regards, tom lane

RE: JDBC Driver under load

From
"Mike Cannon-Brookes"
Date:
It looks to me like there's many queries running that have frozen or are
just taking a long time. Is it possible to see who is connected to postgres,
and what query they're running? Or alternatively, somehow log the queries
time taken? (I have the query statements being logged, looking for the time
taken for each query to also be logged)

-mike

> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Tom Lane
> Sent: Thursday, April 19, 2001 10:55 AM
> To: Mike Cannon-Brookes
> Cc: pgsql-jdbc@postgresql.org
> Subject: Re: JDBC Driver under load
>
>
> What shows up in the postmaster's log when this happens?
>
> (If you're not keeping a postmaster log, now would be a good time
> to start.)
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>