[tor-relays] Limiting Tor Resources

Roman Mamedov rm at romanrm.net
Tue Jun 9 07:46:18 UTC 2020


On Mon, 08 Jun 2020 23:19:37 +0000
AceOfSpadez79 <AceOfSpadez79 at protonmail.ch> wrote:

> When setting up a relay, we are told that Tor doesn't scale well beyond dual
> core systems. So with me having a 6 core CPU, is there a way to sandbox my
> relay and restrict system resources to say, at most 2 cores(4 threads) and 2
> gigs of RAM?
> Now I know simply setting up a virtual machine could solve this, however
> I've had no luck getting the ORPort and DirPort to reach the outside world.
> Probably missed something in the Tor relay or KVM(hate virtualbox btw)
> documentation.

"Doesn't scale well" doesn't mean you have to do anything special to limit it
to fewer cores. It just means that it doesn't really use more than 2 threads,
so there's no use limiting it to 4. If you want to anyway, there's the
"NumCPUs" setting in torrc.

A common way to increase efficiency in your case would be to run a second
instance of Tor. But "that's it", i.e. only two instances per IPv4 address
will work, i.e. adding a third one as well won't be an option with just one IP.

If you want to reduce Tor RAM usage, there's also "MaxMemInQueues" to adjust
in torrc, but typically you wouldn't need to.

-- 
With respect,
Roman


More information about the tor-relays mailing list