Boost logo

Boost Users :

Subject: [Boost-users] [Asio] Measuring and improving SSL servier scalability
From: Konrad Zemek (konrad.zemek_at_[hidden])
Date: 2015-08-16 09:57:33

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.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at