Skip to content

Long ssl handshake latencies #321

Closed
Closed
@mvalkon

Description

@mvalkon

This is more of a question than an issue report. How can I debug SSL handshake latencies? Occasionally the handshakes take hundreds of milliseconds, which seems a little bit unreasonable. I am running an aiohttp server which exposes an API, the load is very small, something like 10-20rps load-balanced on 3 instances of the application. Are there any configuration parameters that I can tune? I am not very familiar with the asyncio-internals in python.

Some random examples from logs

<uvloop.loop.SSLProtocol object at 0x7f106f451050>: SSL handshake took 252.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f4511c0>: SSL handshake took 252.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f451330>: SSL handshake took 252.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f4514a0>: SSL handshake took 252.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430780>: SSL handshake took 504.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430bd0>: SSL handshake took 503.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f4304a0>: SSL handshake took 509.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430a60>: SSL handshake took 508.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f4308f0>: SSL handshake took 508.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430610>: SSL handshake took 509.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430eb0>: SSL handshake took 507.0 ms
<uvloop.loop.SSLProtocol object at 0x7f106f430d40>: SSL handshake took 508.0.ms

Here's 10k measurements from the past 24 hours
image

  • uvloop version: 0.14.0
  • Python version: 3.7.6
  • Platform: docker
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?:
  • Does uvloop behave differently from vanilla asyncio? How?:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions