[tor-relays] Help finding relay bottleneck

James Murphy james.murphy.debian at gmail.com
Mon Mar 23 16:38:12 UTC 2015

I'm running the relay


and am getting substantially lower rates than expected after almost 3
months. I'm on a 1Gbps down/1Gbps up line but my middle relay is just
barely creeping upwards of 5Mbps. This is NOT a problem of less
bandwidth after receiving the guard flag, and I have read the lifecycle
of a new relay documentation.

I cannot find the bottleneck in my setup and was wondering if there are
any good tools I could use to find where it is. I've read
https://www.torservers.net/wiki/setup/server and
https://wiki.archlinux.org/index.php/tor for tips on speeding things up,
but nothing has proven successful.

Things I have considered:
CPU usage: hovers around 5-10%, using NumCPUs 2
Mem usage: 195 MB (10%), using DisableAllSwap 1
Using AvoidDiskWrites 1 to avoid SSD stress
Rate/Burst limits at 20MB (160mbps)

dd if=/dev/urandom of=rand bs=64M count=16 iflag=fullblock
to create a 1GB file I test copying this file to/from another machine on
my LAN using scp
100% 1024MB  28.4MB/s   00:36 to copy to the relay (307 Mbps)
100% 1024MB  53.9MB/s   00:19 to download from the relay (431.2 Mbps)

Okay so not full 1Gbps speeds, but still an order of magnitude higher
than the 5Mbps my relay is using, so the problem doesn't look like it is
the router or gigabit switch on my LAN.

I've also raised the maximum number of open file descriptors for the
debian-tor user. In /etc/security/limits.conf I added
debian-tor       soft    nofile          65000
debian-tor       hard    nofile          65000
I'm not sure if this worked because (even after reboot)
sudo -u debian-tor bash
ulimit -Hn
returns 4096.

I would say that is the problem, but looking in /proc/torPID/fd and doing
ls -l | wc -l
returns 1591, so I'm not hitting the limit of 4096.
In any case, if you know why my limits.conf doesn't appear to have taken
effect, let me know.

I've also added other optimizations from the torservers wiki. My
/etc/sysctl.conf is http://paste.debian.net/162765/

Thanks for the help,
James Murphy

More information about the tor-relays mailing list