Re: SSL encryption makes bytea transfer slow - Mailing list pgsql-performance

From Marti Raudsepp
Subject Re: SSL encryption makes bytea transfer slow
Date
Msg-id CABRT9RBhWGWMvxA7v-mTxcOrZ0ngrnqy66jssKOeokgRqdXqGA@mail.gmail.com
Whole thread Raw
In response to Re: SSL encryption makes bytea transfer slow  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Responses Re: SSL encryption makes bytea transfer slow
Re: SSL encryption makes bytea transfer slow
List pgsql-performance
On Fri, Oct 28, 2011 at 14:02, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Without SSL the SELECT finished in about a second,
> with SSL it took over 23 seconds (measured with
> \timing in psql).

When you query with psql, it requests columns in text format. Since
bytea hex-encodes its value if output is text, this means it's
transmitting 60 MB for a 30 MB bytea value.

If you could make sure that your app is requesting binary output, then
you could cut 50% off this time. As others mentioned, most of the
overhead is in SSL compression (not encryption), which can be
disabled, but is not very easy to do.

But 23 seconds for 60 MB is still *very* slow, so something else could
be going wrong. What kind of CPU is this?

On Thu, Nov 3, 2011 at 16:48, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Disabling OpenSSL compression in the source (which
> is possible since OpenSSL 1.0.0) does not give me any performance
> improvement.

If it doesn't give you any performance improvement then you haven't
disabled compression. Modern CPUs can easily saturate 1 GbitE with
AES256-encrypted connections. Compression is usually the bottleneck,
at 20-30 MB/s.

Regards,
Marti

pgsql-performance by date:

Previous
From: "Tomas Vondra"
Date:
Subject: Re: Optimization required for multiple insertions in PostgreSQL
Next
From: Justin Pitts
Date:
Subject: Re: Guide to PG's capabilities for inlining, predicate hoisting, flattening, etc?