[tor-relays] 100% CPU at random rate

scullcactus scullcactus at riseup.net
Fri Apr 17 20:06:02 UTC 2020


Thanks Gisle and petrarca for confirming that. I thought this is because
of my messed-up OS only.
I linked this thread to the trac's ticket #33554 to for more info on
that.

On 17.04.2020 21:27, Gisle Vanem 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