Discussion:
[asio-users] multithreaded asio service and SSL handshake
Gert Corthout
2015-09-28 08:11:16 UTC
Permalink
Hello
all,



I am currently working on a asio-service
server that will be accepting SSL connections. I currently have the service
running on 4 threads and configured OpenSSL to be threadsafe
(CRYPTO_set_id_callback and CRYPTO_set_locking_callback).

The main load on this server is the RSA
encryption/decryption during the SSL handshake. However it looks like this load
is not distributed in parallel over the different threads, the OpenSSL calls
seem to be serialized.

I found this thread about it for an old asio
version:

http://boost.2283326.n4.nabble.com/ASIO-async-SSL-operations-unnecessary-serialized-td4635792.html



But it looks like since then the asio code
was rewritten (the fixes suggested in the thread also don’t work as they don’t
impact the calling of the handshake code in OpenSSL).



Is this normal behaviour as this is a huge
hit for the performance of the server (and a waste of resources). How can I get
asio to perform the handshakes in parallel?



Thanks for reading,Gert
Ben Pope
2015-09-28 11:13:42 UTC
Permalink
Hello all,
I am currently working on a asio-service server that will be accepting
SSL connections. I currently have the service running on 4 threads and
configured OpenSSL to be threadsafe (CRYPTO_set_id_callback and
CRYPTO_set_locking_callback).
The main load on this server is the RSA encryption/decryption during the
SSL handshake. However it looks like this load is not distributed in
parallel over the different threads, the OpenSSL calls seem to be
serialized.
There is some analysis here:
https://konradzemek.com/2015/08/16/asio-ssl-and-scalability/

Ben

Loading...