[tor-relays] Tor relay occasionally maxing out CPU usage

Alexander Færøy ahf at torproject.org
Wed May 20 13:06:55 UTC 2020


On 2020/05/19 15:59, William Kane wrote:
> Right after, diffs were compressed with zstd and lzma, causing the CPU
> usage to spike.

Thank you for debugging this William.

Tor behaves in the way it is designed to here. Tor uses a number of
worker threads to handle compression (and a couple of other tasks), but
what worries me is how big an impact it has on the traffic processing of
your relay during the time where your relay is also compressing.

I'm a bit curious what the specs are of your relays here -- especially
CPU and memory specs?

> Disabling DirCache still gives me the following warning on Tor 0.4.3.5:
> 
> May 19 17:56:42.909 [warn] DirCache is disabled and we are configured
> as a relay. We will not become a Guard.
> 
> So, unless I sacrifice the Guard flag, there doesn't seem to be a way
> to fix this problem in an easy way.

This is correct for now. Tor have the `NumCPUs` configuration entry,
which defines how many workers we can spawn, but the default value is
sensible for most systems and I doubt it makes sense to tune this for
you.

> Please correct me if I'm wrong.

You're right.

All the best,
Alex.

-- 
Alexander Færøy


More information about the tor-relays mailing list