From: Azat Khuzhin Date: Sat, 16 Mar 2019 14:41:09 +0000 (+0300) Subject: Merge branch 'buffer-read-size' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f4f8769c4e78b14e6aa21d8300f432f67def8df;p=libevent Merge branch 'buffer-read-size' And after this patch set default evbuffer max read via bufferevent is 16K not 4K. Here is some numbers for the single max read in evbuffer impact: function client() { becat "$@" | pv > /dev/null; } function server() { cat /dev/zero | becat -l "$@"; } Plain bufferevent: - 40K $ server -R $((40<<10)) & client -R $((40<<10)) 700MiB/s - 16K *default now* $ server & client 1.81GiB/s - 4K $ server -R $((4<<10)) & client -R $((4<<10)) 1.05GiB/s With OpenSSL (-S): - 40K *default now* $ server -S -R $((40<<10)) & client -S -R $((40<<10)) 900MiB/s - 16K *default now* $ server -S & client -S 745MiB/s - 4K $ server -S -R $((4<<10)) & client -S -R $((4<<10)) 593MiB/s So as you can see without openssl 16K is faster then 40K/4K, while for openssl 40K is still faster then 16K (I guess that this is due to with openssl SSL_read() more at at time, while with plain we have some allocations splits in evbuffer and maybe due to some buffer in openssl) * buffer-read-size: sample/becat: bufferevent cat, ncat/nc/telnet analog Adjust evbuffer max read for bufferevents Maximum evbuffer read configuration Fix leaks in error path of the bufferevent_init_common_() --- 1f4f8769c4e78b14e6aa21d8300f432f67def8df