I measured the time it took to complete a TLS handshake using Rustls and OpenSSL with nginx, and it was more than twice as fast.

Mr. Hasegawa of the Service Reliability Group (SRG) of the Media Headquarters@rarirureluis is.
#SRG(Service Reliability Group) is a group that mainly provides cross-sectional support for the infrastructure of our media services, improving existing services, launching new ones, and contributing to OSS.
This article is about measuring whether Rustls is faster than OpenSSL, now that Rustls is compatible with nginx.
 

Rustls


Rustls is a modern Transport Layer Security (TLS) library written in Rust. It is primarily designed with an emphasis on safety and performance, and aims to replace memory-unsafe alternatives like OpenSSL. Rustls implements TLS 1.2 and TLS 1.3 for both clients and servers.
 

Let's Encrypt certificate authority also plans to migrate


ISRG's Let's Encrypt certificate authority will begin replacing OpenSSL with Rustls later this year.
 
Does that mean Rustls is better than OpenSSL?
 

install


 

Comparing Rustls + nginx with OpenSSL


Integrate Rustls into Nginx and run the following script.
  • 100 requests
  • Get p50, p95, p99
 

nginx + OpenSSL

 

nginx + Rustls

Conclusion


I embedded Rustls into nginx and investigated its advantages over OpenSSL.
As the benchmark results show, Rustls outperforms in every metric, achieving more than twice the speedup on p99.
 
SRG is looking for people to work with us. If you're interested, please contact us here.