Re: Speed problems with both system openssl and security/openssl-devel

From: John-Mark Gurney <jmg_at_funkthat.com>
Date: Fri, 21 Sep 2018 23:35:36 -0700
Lev Serebryakov wrote this message on Mon, Sep 17, 2018 at 23:52 +0300:
> Thursday, September 13, 2018, 2:46:46 AM, you wrote:
> 
> >   Linux have openssl 1.1.0f, and  I've tried both system /usr/bin/openssl (1.0.2p)
> > and /usr/local/bin/openssl from security/openssl-devel port (1.1.0i), results are
> > virtually the same. I have "ASM" and "SSE2" options enabled in port.
> 
> >  What happens here? Why does FreeBSD's build of openssl use AES-NI so
> > inefficient?
>  More datapoints.
> 
> (1) aes-256-cbc behaves really wired. Time output is
> completely bogus without "-elapsed" and speed is unbelievably low with
> "-elapsed". aes-256-gcm doesn't have this anomaly

This is because you're likely using /dev/crypto for the operations instead
of software...

$openssl engine 
(cryptodev) BSD cryptodev engine
(dynamic) Dynamic engine loading support

The times below are mesured on how much cpu time openssl spent, while
all the work was done in the kernel...

if you disable cryptodev usage, you should see better performance...

> without "-elapsed" (please note "in 0.xxs" here):
> 
> Doing aes-256-cbc for 3s on 16 size blocks: 503555 aes-256-cbc's in 0.60s
> Doing aes-256-cbc for 3s on 64 size blocks: 520386 aes-256-cbc's in 0.54s
> Doing aes-256-cbc for 3s on 256 size blocks: 435106 aes-256-cbc's in 0.44s
> Doing aes-256-cbc for 3s on 1024 size blocks: 242832 aes-256-cbc's in 0.38s
> Doing aes-256-cbc for 3s on 8192 size blocks: 49087 aes-256-cbc's in 0.09s
> ...
> aes-256-cbc      13393.26k    61782.64k   254599.17k   663093.25k  4289287.51k
> 
> Doing aes-256-gcm for 3s on 16 size blocks: 12051311 aes-256-gcm's in 3.03s
> Doing aes-256-gcm for 3s on 64 size blocks: 6428598 aes-256-gcm's in 3.04s
> Doing aes-256-gcm for 3s on 256 size blocks: 2122316 aes-256-gcm's in 3.00s
> Doing aes-256-gcm for 3s on 1024 size blocks: 610443 aes-256-gcm's in 3.13s
> Doing aes-256-gcm for 3s on 8192 size blocks: 75836 aes-256-gcm's in 3.03s
> ...
> aes-256-gcm      63611.04k   135380.66k   181104.30k   199531.13k   204947.96k
> 
> with "-elapsed":
> 
> Doing aes-256-cbc for 3s on 16 size blocks: 493829 aes-256-cbc's in 3.01s
> Doing aes-256-cbc for 3s on 64 size blocks: 530550 aes-256-cbc's in 3.06s
> Doing aes-256-cbc for 3s on 256 size blocks: 426699 aes-256-cbc's in 3.01s
> Doing aes-256-cbc for 3s on 1024 size blocks: 243305 aes-256-cbc's in 3.03s
> Doing aes-256-cbc for 3s on 8192 size blocks: 48069 aes-256-cbc's in 3.01s
> ...
> aes-256-cbc       2626.91k    11087.41k    36317.07k    82191.94k   130919.48k
> 
> Doing aes-256-gcm for 3s on 16 size blocks: 12041385 aes-256-gcm's in 3.08s
> Doing aes-256-gcm for 3s on 64 size blocks: 6445757 aes-256-gcm's in 3.05s
> Doing aes-256-gcm for 3s on 256 size blocks: 2129499 aes-256-gcm's in 3.01s
> Doing aes-256-gcm for 3s on 1024 size blocks: 587396 aes-256-gcm's in 3.01s
> Doing aes-256-gcm for 3s on 8192 size blocks: 75806 aes-256-gcm's in 3.03s
> ...
> aes-256-gcm      62590.75k   135047.68k   181245.26k   199977.06k   204866.89k

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Sat Sep 22 2018 - 04:35:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:18 UTC