[Asio] Measuring and improving SSL servier scalability
Hi all, I've built a few different Asio-based SSL servers in my career, but in my recent project the performance and resource-efficiency was paramount (as it's a library project), so I benchmarked it to make sure. Long story short, when benchmarking I found out that OpenSSL's error handling is a *very* serious bottleneck when scaling Asio+SSL over multiple threads. This can be "fixed", e.g. by using BoringSSL instead of OpenSSL, as BoringSSL uses thread-local storage for error data instead of locking a global mutex. As I didn't find any resources discussing bad Asio+SSL multithreaded performance (aside of one or two messages somewhere on this mailing list that complained about the problem; unfortunately I can't seem to find them right now), I've written up my knowledge into a blog post [1]. I believe it might be very useful to anyone who wants to build a multi-threaded SSL server/client on top of Asio. Konrad [1] https://konradzemek.com/2015/08/16/asio-ssl-and-scalability/
* Konrad Zemek
Hi all,
I've built a few different Asio-based SSL servers in my career, but in my recent project the performance and resource-efficiency was paramount (as it's a library project), so I benchmarked it to make sure.
Long story short, when benchmarking I found out that OpenSSL's error handling is a *very* serious bottleneck when scaling Asio+SSL over multiple threads. This can be "fixed", e.g. by using BoringSSL instead of OpenSSL, as BoringSSL uses thread-local storage for error data instead of locking a global mutex.
As I didn't find any resources discussing bad Asio+SSL multithreaded performance (aside of one or two messages somewhere on this mailing list that complained about the problem; unfortunately I can't seem to find them right now), I've written up my knowledge into a blog post [1]. I believe it might be very useful to anyone who wants to build a multi-threaded SSL server/client on top of Asio.
The 0.11-devel brance of has support for SSL. Any idea how that stacks up?
Konrad
[1] https://konradzemek.com/2015/08/16/asio-ssl-and-scalability/ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- -ericP office: +1.617.599.3509 mobile: +33.6.80.80.35.59 (eric@w3.org) Feel free to forward this message to any list for any purpose other than email address distribution. There are subtle nuances encoded in font variation and clever layout which can only be seen by printing this message on high-clay paper.
On 17.08.2015 22:54, Eric Prud'hommeaux wrote:
* Konrad Zemek
[2015-08-16 15:57+0200] Hi all,
I've built a few different Asio-based SSL servers in my career, but in my recent project the performance and resource-efficiency was paramount (as it's a library project), so I benchmarked it to make sure.
Long story short, when benchmarking I found out that OpenSSL's error handling is a *very* serious bottleneck when scaling Asio+SSL over multiple threads. This can be "fixed", e.g. by using BoringSSL instead of OpenSSL, as BoringSSL uses thread-local storage for error data instead of locking a global mutex.
As I didn't find any resources discussing bad Asio+SSL multithreaded performance (aside of one or two messages somewhere on this mailing list that complained about the problem; unfortunately I can't seem to find them right now), I've written up my knowledge into a blog post [1]. I believe it might be very useful to anyone who wants to build a multi-threaded SSL server/client on top of Asio.
The 0.11-devel brance of has support for SSL. Any idea how that stacks up?
Some words seem to be missing from this sentence (most notably name of a project); could you clarify? Konrad
participants (2)
-
Eric Prud'hommeaux
-
Konrad Zemek