Re: long transfer time for binary data

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Johannes <jotpe(at)posteo(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: long transfer time for binary data
Date: 2016-01-21 02:33:49
Message-ID: 56A0438D.6090903@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/20/2016 03:29 PM, Johannes wrote:
> I noticed transferring a large object or bytea data between client and
> server takes a long time.
> For example: An image with a real size of 11 MB could be read on server
> side (explain analyze) in 81ms. Fine.
>
> But on client side the result was completed after 6.7 seconds without
> ssl compression and 4.5 seconds with ssl compression (both via 100MBit
> ethernet).
>
> SSL compression seems to be not a good idea anymore, since this had
> become a security risk. Its still possible with pgadmin, but afaik not
> with java/jdbc .
>
> Are there any other solutions available to display my images in my
> client application more quickly? Or are there planned improvements to
> postgresql (transferring the real binary data)?
>
> Best regards
> Johannes
>

Yep, that's slow. The ssl compression is very odd if the image is jpeg'ish and already compressed. If its a bitmap or uncompressed tif then its not so surprising.

A few tests you could try:

1) copy the same 11 meg file from server to client via regular file copy and time it. At 100 Mbit/s it should take about a second. If it takes 6 you have network problems, not PG problems.

2) try it via psql command line (or at least something other than java), to see if its java thats the problem.

3) watch wireshark/tcpdump, maybe you'll see something glaring that'll point you in the right direction.

-Andy

PS: I've never heard that ssl compression was a security risk, got links/proof?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2016-01-21 02:50:11 Re: adding a bdr node using bcv backup
Previous Message Scott Mead 2016-01-21 02:00:22 Re: How to stop autovacuum for daily partition old tables