curl / Mailing Lists / curl-library / Single Mail


Re: libssh2 optimization [was: Re: Windows users! Help us test upload performance tuning?]

From: Daniel Jeliński via curl-library <>
Date: Sun, 26 Aug 2018 09:09:58 +0200

niedz., 26 sie 2018 o 03:36 Jan Ehrhardt via curl-library
<> napisał(a):
> Do you have any stats about the performanceimprovement?

I am running curl against openssh 7.2 shipped with Ubuntu. The server
is running on the same machine as the client. I am uploading 1GB file
to /dev/null on the server. My laptop is running a 2nd gen i3 CPU
without hardware AES support. I'm tweaking network latency using tc.
Curl speed was taken from curl-reported average when the transfer took
less than a minute. For slower transfers I took a representative value
from the momentary upload speed.

Results with 16kB curl upload buffer:
no delay added: original 12MB/sec, patched 33 MB/sec
added 20 ms: original 390kB/sec, patched 26.6 MB/sec
added 100ms: original 81 kB/sec, patched 9700 kB/sec
Results with 64kB curl upload buffer:
no delay added: original 27MB/sec, patched 35 MB/sec
added 20 ms: original 1400kB/sec, patched 30MB/sec
added 100ms: original 310kB/sec, patched 9900kB/sec

The patched version is CPU-bound on lower latencies; when the latency
goes higher, SSH window becomes the limiting factor. I read that HPN
SSH should do better on high latency links, didn't try it out.

Separately I have a work-in-progress patch that improves the CPU
usage; I was able to reach 80MB/s transfers with that patch applied.
You can see it here:
It's not ready for inclusion; it requires cleanup, and breaks SSL
backends other than openSSL with AES-CTR support. If you have openSSL
with AES support, it might be worth a try.

Received on 2018-08-26