[tor-bugs] #23433 [Core Tor/Tor]: Windows relay: 85% of CPU power is wasted inside select() call

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Sep 8 08:28:41 UTC 2017

#23433: Windows relay: 85% of CPU power is wasted inside select() call
     Reporter:  Vort          |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: unspecified
    Component:  Core Tor/Tor  |    Version:  Tor:
     Severity:  Normal        |   Keywords:  tor-relay windows
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
 Since I have eliminated the network slowdown with patch from #22798, I
 have started to face another problem:
 As connection count began to grow, CPU resources consumption start growing
 Now, with 3700 connections and 1 MiB/s of Tor traffic, CPU is
 [[attachment:tor_cpu.png|loaded at 15%]].
 With 3 MiB/s of traffic, CPU load goes up to maximum 25% (full load of 1
 CPU core).
 It is possible to think that Tor uses much cryptography and that thing is
 overloading my PC. But no.
 Much of the time (88 hours of total 102 hours) tor.exe process spends in
 kernel mode. Most probably, inside `WS2_32.dll!select` function (called
 from libevent library).
 This specificity limits maximum speeds, which can be achieved using Tor
 relay with Windows.
 And, most likely, it can be fixed by using the different approaches for
 network API interaction.

 CPU: Intel Core i5-4690
 OS: Windows 7 SP1 x64

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23433>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tor-bugs mailing list