<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="ltr">Hi,</div><div dir="ltr"><br><blockquote type="cite">On 12 Apr 2020, at 10:10, Mario Costa <mario.costa@icloud.com> wrote:</blockquote></div><blockquote type="cite"><div dir="ltr"><span></span><br><span>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.</span><br></div></blockquote><div><br></div>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.<br><div><br></div><div>Tor also assumes your connection is full duplex. (That is, there are separate limits of 10 MB/s up and 10 MB/s down.)</div><div><br></div><div>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.)</div><br><blockquote type="cite"><div dir="ltr"><span>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.</span><br></div></blockquote><div><br></div><div>Where are you seeing this observed bandwidth?</div><div><br></div><div>Tor reports its observed bandwidth over the busiest 10 second period each day.</div><div><br></div><div>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.)</div><div><br></div><div>If your connection is a high latency connection, Tor may send bandwidth to lower-latency connections.</div><div><br></div><div>You can read a similar thread here:</div><div><a href="https://lists.torproject.org/pipermail/tor-relays/2020-April/018348.html">https://lists.torproject.org/pipermail/tor-relays/2020-April/018348.html</a></div><br><blockquote type="cite"><div dir="ltr"><span>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?</span><br></div></blockquote><div><br></div><div>4000 seems pretty normal. There are only around 6000 relays.</div><div>Check your tor, kernel, and router logs for TCP warnings?</div><br><blockquote type="cite"><div dir="ltr"><span>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.</span><br></div></blockquote><div dir="ltr"><br></div>Setting your burst higher than your connection speed can cause latency or packet drops. Tor will allocate less bandwidth to slow or unreliable relays.<br><div><br></div>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.<div><br></div><div>Tor will compensate for a burst by having a few slow seconds afterwards.<br><div><br></div><div>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.)</div><br><blockquote type="cite"><div dir="ltr"><span>For reference my relay’s fingerprint is F942EE73F1B8E39125F617FA85E80E4C9E540A2E.</span><br></div></blockquote><br></div><div>If you want Tor to use more bandwidth, try setting rate and burst to 10 Mbps.</div><div><br></div><div>That way, you won't be causing congestion or packet drops.</div><div><br></div><div>You may have to wait for a few weeks or months for your bandwidth to stabilise.</div><div><a href="https://blog.torproject.org/lifecycle-new-relay">https://blog.torproject.org/lifecycle-new-relay</a></div><div><br></div><div>T</div><div><br></div></div></body></html>