[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-relays] How to reduce tor CPU load on a single bridge?



On Tue, 28 Dec 2021 21:39:27 +0100 (CET)
abuse--- via tor-relays <tor-relays@xxxxxxxxxxxxxxxxxxxx> wrote:

> why would that be needed? Linux has a pretty good thread scheduler imo and
> will shuffle loads around as needed.

To improve cache locality, as in modern CPUs L1/L2/L3 cache is partitioned
into various schemes per core or core cluster. So it is benificial if the same
running thread gets stuck to a particular core or set of cores, as that's where
it would have all cached data still warm in cache from its previous
timeslices, and is not shuffled around to other cores.

But in theory the OS scheduler should be smart enough to ensure that without
manual intervention.

Also I am not sure how relevant that is for the kind of computation that Tor
does. And in any case, it is a "nice to have" which usually shouldn't make a
huge difference.

Ideally though, the application thread handling the incoming data should also
run on the same CPU core that just handled the incoming IRQ from NIC. But that
requires support across all of the application, OS, NIC hardware and driver,
and very careful tuning.

-- 
With respect,
Roman
_______________________________________________
tor-relays mailing list
tor-relays@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays