Nginx: it takes too long to establish a ssl connection

debiannginxssl

I have a nginx set up with ssl certifivate. Recently I noticed, that establishing connection to that server sometimes takes way too long (8+ seconds). In chrome developer tools I can see, that all of that time goes to connecting phase. Problem exists both for dynamic content (php) and for static (html, css). At the same time server responds flawlessly to the same, non-ssl requests. It does not happen for each request, but it causes timeouts to many of ajax requests (some of those are crucial to the service).

I tried to follow this guide: http://unhandledexpression.com/2013/01/25/5-easy-tips-to-accelerate-ssl/ but it didn't help.

Any idea how can I find the source of the problems? Any potential fixes?

Best Answer

Short, painful (yet correct) answer is: It is not nginx-connected problem.

I did more testing via usage of wget loop and as it turns out it is not a server problem. Somehow connections from another location are correct. Yet it doesn't seem to be my connection problem because any other ssl on different server works correctly. Continuing to investigate further.