# SSL handshaking very slow

**URL:** <https://www.ruby-forum.com/t/ssl-handshaking-very-slow/199628>\
**Category:** NGINX\
**Created:** [November 25, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/ssl-handshaking-very-slow/199628 "2010-11-25T12:40:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 25, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/ssl-handshaking-very-slow/199628/1 "2010-11-25T12:40:44Z")

</div>

hi there,  
I’m running the latest stable version of nginx and running into a  
strange issue. after a few hour of operation, SSL handshaking stars to  
become very, very slow. in some cases, establishing an SSL connection  
will take over 30 seconds and the browser consequently timeouts. that  
said, when an SSL connection is established, everything is blazing fast.  
similarly, accessing the site over HTTP is fast.

restarting nginx doesn’t seem to fix the machine once it gets into this  
state. the only fix is to restart the whole machine. I generally have  
something like 20k SSL sessions active on this machine. changing the SSL  
session timeouts, etc. has no effect once the machine gets into this  
state. are there any obvious parameters (either nginx specific or  
system) that I should be looking at? thanks greatly in advance.

-arash

Posted at Nginx Forum:

> **[SSL handshaking very slow](https://forum.nginx.org/read.php?2,153231,153231#msg-153231)**
>
> hi there, I'm running the latest stable version of nginx and running into a strange issue. after a few hour of operation, SSL handshaking stars to become very, very slow. in some cases, establishing an SSL connection will take over 30 seconds and the...

---

<div class="post-metadata">

**Author:** ![arashf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@arashf](https://www.ruby-forum.com/u/arashf)\
**Post date:** [November 27, 2010, 10:13am UTC](https://www.ruby-forum.com/t/ssl-handshaking-very-slow/199628/2 "2010-11-27T10:13:28Z")

</div>

Arash,

It sounds like your system is running out of entropy. Every time a new  
SSL connection is made the system needs to have a certain amount of  
“randomness” to make new ssl key negotiations. 20K new connections  
seems like a entropy resource starvation. If you are running Linux  
check out “rngd” and take a look at our page at the following link.

Entropy and Random Number Generators  
[https://calomel.org/entropy\_random\_number\_generators.html](https://calomel.org/entropy_random_number_generators.html)

–  
Calomel @ [https://calomel.org](https://calomel.org)  
Open Source Research and Reference
