Hi,
On 12 Apr 2020, at 10:10, Mario Costa mario.costa@icloud.com wrote:
I’m running a guard relay from my home connection on a Raspberry Pi 4. My internet connection is 1000/100 Mbps, and I thought I’d allocate half of the upload bandwidth for the relay. Then I set RelayBandwidthRate to 10 MB/s, because I thought that Tor would upload 5 MB/s and download 5 MB/s.
You have an asymmetric connections and Tor is a relay network. So your relay's speed will be limited by the slowest of your upload and download.
Tor also assumes your connection is full duplex. (That is, there are separate limits of 10 MB/s up and 10 MB/s down.)
You should set rate to the highest sustained bandwidth you're happy for Tor to use. Tor could use that much bandwidth for seconds or hours. That bandwidth should be lower than your connection bandwidth. (The minimum of your upload and download.)
However, the maximum observed bandwidth was always about 6 MB/s. I’d like to know what could cause this low observed bandwidth. I don’t think it’s the Raspberry Pi, because CPU usage is always low and it has a Gigabit connection to the router.
Where are you seeing this observed bandwidth?
Tor reports its observed bandwidth over the busiest 10 second period each day.
60% of the rate is actually a pretty high load, because Tor is a low-latency network. (Once utilisation gets over around 10%, latency starts increasing.)
If your connection is a high latency connection, Tor may send bandwidth to lower-latency connections.
You can read a similar thread here: https://lists.torproject.org/pipermail/tor-relays/2020-April/018348.html
The router itself easily reaches Gigabit speeds, so 10 MB/s should be a breeze. Could it be the number of connections? nyx indicates that the connections are always about 4000. If this is the case, how can I know if the connections bottleneck is the router or the Raspberry Pi?
4000 seems pretty normal. There are only around 6000 relays. Check your tor, kernel, and router logs for TCP warnings?
Additionally, I’d like to ask for a rule of thumb for setting the RelayBandwithBurst. I set it to 20 MB/s because I’m ok with the relay using the whole upload bandwidth (about 10 MB/s, or 100 Mbps) for short periods of time, but as I already explained I’m never seeing such speeds.
Setting your burst higher than your connection speed can cause latency or packet drops. Tor will allocate less bandwidth to slow or unreliable relays.
You won't see the burst in Tor's observed bandwidth. The burst is over 1-2 seconds. The rate is averaged over a few seconds. Observed is over 10 seconds.
Tor will compensate for a burst by having a few slow seconds afterwards.
Set the burst to the highest speed you ever want the relay to use over 1-2 seconds. The burst should be equal to or lower than your connection speed. (In your case, the lowest of your upload and download speed.)
For reference my relay’s fingerprint is F942EE73F1B8E39125F617FA85E80E4C9E540A2E.
If you want Tor to use more bandwidth, try setting rate and burst to 10 Mbps.
That way, you won't be causing congestion or packet drops.
You may have to wait for a few weeks or months for your bandwidth to stabilise. https://blog.torproject.org/lifecycle-new-relay
T