SSL connections take longer to connect and takes 100% CPU during that time

Bug #250496 reported by Big Muscle
2
Affects Status Importance Assigned to Milestone
DC++
Confirmed
Medium
Unassigned

Bug Description

When you make a lot of SSL/TLS (don't know the right terminology for it) connections, it still takes longer time to connect than normally. I think this can't be solved easily, because it needs to transmit certificate/key during to handshake.

But what's really wrong is that CPU usage raises up to 100% during this operation. And this should be fixed.
i thought it is caused by fast looping in ConnectionManager::run() when processing too many accept()'s, but inserting Sleep(1000) doesn't change anything, so it must be anywhere else.

It can be easily reproduced when you make secure connections to all users in DCDev public (for example by "Browse file list"). While all filelists display immediately with very low CPU usage when TLS is disabled, it will take longer time with 100% CPU usage when TLS is enabled.

Tags: core
Big Muscle (bigmuscle)
description: updated
eMTee (realprogger)
Changed in dcplusplus:
status: New → Confirmed
Revision history for this message
Jacek Sieka (arnetheduck) wrote :

you haven't run this through a profiler, have you? it could be that creating up ephemeral keys for dhe takes some time...

Revision history for this message
Big Muscle (bigmuscle) wrote :

I have run it under profiler now, but I don't know what I should look for. There are columns "time", "time with children", "shared time" and "hit count". The most of time is occupied by Socket::wait, but it's logical because it waits there. I'm using AQTime Profiler.

Fredrik Ullner (ullner)
Changed in dcplusplus:
importance: Undecided → Medium
Fredrik Ullner (ullner)
tags: added: core
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.