[tor-relays] CPU usage

Scott Bennett bennett at sdf.org
Tue Jul 8 09:51:19 UTC 2014


Roman Mamedov <rm at romanrm.net> wrote:

> On Mon, 7 Jul 2014 23:30:22 -0700
> "Asa Rossoff" <asa at lovetour.info> wrote:
>
> > With hyperthreading, I think 4 would be optimal?
>
> Yes, 4 can be set, but I remember reading somewhere that Tor doesn't scale
> well beyond NumCPUs 2 (and poorly even to 2).

     See my previous note in this thread.  Note that NumCPUs specifies the
number of [logical] CPUs available for simultaneous onionskin decryption
threads to make use of.  Those worker threads are not used for any other
work, AFAIK.
>
> One way to increase utilization further would be to run a second instance of
> Tor. However as this server is also used for other tasks, this could begin
> starving them of CPU time via the hyperthreading concurrency even while Tor
> nominally runs at lower nice levels.
>
     It seems to me that an Atom is a tad underpowered for that sort of
scheduling.  One instance is enough.  If the OP wishes to make better use
of his network throughput capacity with tor, then he needs to get a more
powerful machine to do it.
     Another matter to consider is that very high-throughput relays need
to run on operating systems that support superpages (a.k.a. hugepages in
LINUX) to reduce the large percentage of time wasted in processor stalls
due to TLB thrashing.  Microsoft only supports that when set up manually,
IIRC.  LINUX used to be likewise, but I seem to recall reading somewhere
that its developers eventually wised up and made them automatic, like in
FreeBSD.  I have no idea whether NetBSD or OpenBSD supports superpages at
all.


                                  Scott Bennett, Comm. ASMELG, CFIAG
**********************************************************************
* Internet:   bennett at sdf.org   *or*   bennett at freeshell.org   *
*--------------------------------------------------------------------*
* "A well regulated and disciplined militia, is at all times a good  *
* objection to the introduction of that bane of all free governments *
* -- a standing army."                                               *
*    -- Gov. John Hancock, New York Journal, 28 January 1790         *
**********************************************************************


More information about the tor-relays mailing list