Secure Shell
High latency when port-forwarding postgresql (for statements which don't return data) Mar 22 2011 01:35PM
Clemens Eisserer (linuxhippy gmail com) (1 replies)

I experience a very strange problem, when using the jdbc driver with
ssh's local port forwarding:
ssh -v -L 4321:dbserver:5432 user@dbserver

SELECT statements show about the same latency as without
port-forwarding (and even decreased latency when compression is
enabled), but sometimes UPDATE/DELETE statements take seconds to
The other time they are as fast as they should be. When I connect to
postgres without port-forwarding the update statements consistently
take only a few milliseconds.

Any idea what the reason could be, I've tested it with two different
ssh clients (one java, and openssh) both show the same behaviour.
Could it be some buffering on the server side, to make data transfer
more efficient?
Could it be because selects usually send a lot of data back to the
client, buffering doesn't hurt - but for update/delete usually only a
acknoledgement is sent back and buffering starts to be an issue?

Thank you in advance, Clemens

Btw the java-based client seems to be waiting for data while it
executes the statements: Method)
- locked org.postgresql.core.v3.QueryExecutorImpl@17b1683

[ reply ]


Privacy Statement
Copyright 2010, SecurityFocus