How does Tor meter bandwidth?

I’ve set up a relay almost a week ago which is on a Cloud provider offering 0.5 Gbps speed.

The speed in megabytes per second (MB/s) is calculated by dividing the advertised speed in gigabits per second (Gbps) by 8, as there are 8 bits in 1 byte. So, for an advertised speed of 0.5 Gbps:

0.5 Gbps = 0.5 * 1000 Mbps = 500 Mbps
500 Mbps / 8 = 62.5 MB/s

However, my relay advertises a speed of around 7.5MB/s, shouldn’t it be higher? I’m not expecting to get the whole 62MB/s speed, but at least 30 or 40 since I do not throttle the connection speed on my relay. The instance is dedicated to the relay, so nothing much should be consuming bandwidth.

While it is true that I expect a higher advertised bandwidth, my relay’s AB has been increasing along it’s consensus weight. Which was at 11.000, although it has now dropped to 9900. Does consensus also decrease with maintenance reboots? I plan to reboot the instance every ~2 weeks. Also, I noticed a couple warnings on nyx about the relay being unresponsive and then resuming after a minute or so.

From what I know, Tor relay code is just not optimized enough to serve large bandwidth.
That’s why people launch several relays on the same IP address.
There is a limit of how many relays per IP is allowed, right now it is at 8, but it should be enough for your configuration.

Bandwidth is quite nuanced. All my relays are 1gbit and some even 10gbit full duplex connections, but they don’t come near that in practise. Most connections are only peak, and are shared with other servers. It also depends how the datacenter is connected to the rest of the world. Some datacenters even throttle you based on “fair use”. I even have servers at the same hoster, with the exact same spec, on the same location - but one does TWICE the bandwidth compared to the other. Some hosters just lie as well - haha.

Note as well that advertised bandwidth is only peak. Your continued bandwidth is shown in the graph and is always lower.

Consensus is tricky. If you reboot fast, it shouldn’t be an issue but if you’re down for a longer time or reboot too often - it will impact your relay weight as it’s seen as less stable. It’s normal for your % to drop after sharp increases during your initial relay phase. You can read about it in one of the blogs about it. It’s quite a black hole, but in general stability and bandwidth are the most important.

Mwah, what is large bandwidth? My fastest relay does 20MB/s continued, with 35-40MB peak - without any optimization. Tor isn’t multi-threaded if that’s what you mean. So single core performance is critical, hence I’m running AMD Ryzen / Threadrippers.

1 Like

It is partially multi-threaded, but not enough to launch single relay process and hope that it will use all available bandwidth.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.