[tor-relays] 100% CPU at random rate
Gisle Vanem
gisle.vanem at gmail.com
Fri Apr 17 17:58:37 UTC 2020
scullcactus wrote:
> My problem is, and long time has been, the following. Every 30-40-60-120
> minutes (it varies) I suddenly see CPU consumption jumps to 100% because
> of tor process, so I need to stop/start it to settle things down. Also,
> when I start Tor after a period of inactivity, say, a few hours or
> night, I cannot start it reliably for the first time, ever. It goes up
> to "Bootstrapped 95% (circuit_create): Establishing a Tor circuit" log
> message and... 100% CPU. After the second start, I get 100% CPU with
> 50/50 probability, and after the 3rd, it finally is OK, most of the
> time. Then, this 30-40-60-120 minutes cycle begins... It happens with
> this "Bootstrapped 95% ..." message or a bit before that.
I've seen the same and patched like this:
--- a/lib/thread/compat_winthreads.c 2020-01-24 21:59:07
+++ b/lib/thread/compat_winthreads.c 2020-04-09 08:55:04
@@ -170,6 +170,8 @@
do {
DWORD res;
res = WaitForSingleObject(cond->event, ms);
+
+ SleepEx(1, TRUE);
EnterCriticalSection(&cond->lock);
if (cond->n_to_wake &&
cond->generation != generation_at_start) {
-------------
That always did the trick.
I reported it here:
https://trac.torproject.org/projects/tor/ticket/33411
--gv
More information about the tor-relays
mailing list