Performance
Lee McKenna
lee@lodgenet.com
Mon Nov 19 18:46:01 2001
Werner Koch wrote:
>On Mon, 19 Nov 2001 09:17:25 -0600, Lee McKenna said:
>
>>I have tried different key lengths (768 - 2048) and I've tried every
>>cipher available to try to improve performance, but I get about the
>>
>
>The keylength does not matter for large files. Only the performance
>of the symmetric cipher algorithm counts. It depends on the recipients
>preference which algorithm is chosen, to get more reliable numbers you
>should use "gpg -c --cipher <algo>". Try 3DES, BLOWFISH and AES - I
>have no benchmarks for large files - I can only remember that it took
>quite long to test the large file support ;-)
>
>>Any suggestions on improving performance?
>>
>
>RIJNDAEL should be the fasted. You may want to tweak the IOBUFs (grep
>for iobuf_alloc in util/iobuf.c) or the hash buffers (cipher/md.c
>md_open).
>
A little background info...we maintain over 1 TB of large encrypted
files, with 50-75GB new each month. gnupg has been working wonderfully
for over a year now on our large files, I think the largest has been
over 7GB, while the average is 3.5GB. I'm not really complaining too
much about performance, but we do have one "business" instance whereby
it would be "nice" if it was maybe twice the speed it currently is :)
For the record book :) I ran the following tests using gpg 1.0.6,
1024bit key, on a PIII/800, 256MB RAM, SCSI/IDE RAID, stock FreeBSD 4.3
release, on a file size 3363088179 (3.3GB). CAST5 is the fastest, 3DES
slowest. All others are relatively close.
The file is an MPEG2 movie. We've experimented with compression -z
options, but we found it of no use on these MPEG2 files (in fact,
detrimental to speed and file size), hence the -z0 in our script.
Here is a snipet of the test script I used so you can see the gpg
command syntax:
-----------
echo -e '\n3DES encrypt' >>timer.dat
/usr/bin/time -a -h -o timer.dat cat 23054.mpg | gpg -e -z0 -o
23054.mpg.3DES.gpg --cipher-algo 3DES -r content
#
echo -e '\n3DES decrypt' >>timer.dat
/usr/bin/time -a -h -o timer.dat gpg -v -d -o 23054.mpg.3DES.decrypted
23054.mpg.3DES.gpg
-----------
Here is the output file timer.dat:
3DES encrypt
15m3.50s real 0.21s user 18.73s sys
3DES decrypt
18m45.87s real 17m54.32s user 41.26s sys
CAST5 encrypt
9m11.62s real 0.20s user 20.35s sys
CAST5 decrypt
9m59.68s real 8m59.71s user 42.02s sys
BLOWFISH encrypt
9m44.20s real 0.27s user 19.47s sys
BLOWFISH decrypt
11m28.13s real 10m39.52s user 40.37s sys
RIJNDAEL encrypt
9m18.35s real 0.27s user 19.80s sys
RIJNDAEL decrypt
11m15.23s real 10m26.04s user 41.63s sys
RIJNDAEL192 encrypt
9m31.82s real 0.23s user 19.51s sys
RIJNDAEL192 decrypt
11m45.56s real 10m55.74s user 42.09s sys
RIJNDAEL256 encrypt
9m45.13s real 0.21s user 19.65s sys
RIJNDAEL256 decrypt
12m21.69s real 11m26.39s user 42.01s sys
TWOFISH encrypt
9m38.59s real 0.22s user 19.46s sys
TWOFISH decrypt
11m28.03s real 10m37.77s user 41.13s sys
768bit RIJNDAEL256 encrypt
9m32.32s real 0.26s user 19.57s sys
768bit RIJNDAEL256 decrypt
12m32.70s real 11m30.50s user 40.94s sys
Symetric (-c) RIJNDAEL256 decrypt
10m2.10s real 0.24s user 19.89s sys
Symetric (-c) RIJNDAEL256 decrypt
12m19.85s real 11m28.25s user 42.16s sys