Tor Relay Bandwidth Throttling: Diagnosing and Fixing Performance Issues
Tor relay operators frequently encounter bandwidth throttling that reduces their relay's performance and consensus weight. Throttling can come from two sources: external throttling by the VPS provider (enforcing contract bandwidth limits) or internal throttling through misconfigured BandwidthRate directives in torrc. Distinguishing between these causes and resolving them requires understanding how Tor's bandwidth accounting works, how VPS providers implement bandwidth limits, and what the Tor directory authority consensus weight system expects. This guide covers diagnosing the throttling source, adjusting Tor's bandwidth configuration for maximum throughput within VPS contract limits, and selecting VPS providers and plans appropriate for high-bandwidth relay operation.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
Tor's bandwidth configuration uses token bucket rate limiting. BandwidthRate sets the average sustained bandwidth Tor will use. BandwidthBurst sets the maximum instantaneous rate (used for short bursts above BandwidthRate). Example: BandwidthRate 100 MB, BandwidthBurst 200 MB allows sustained 100 MB/s with bursts to 200 MB/s. Tor enforces this internally - if BandwidthRate is set too conservatively, the relay will not use its available network capacity even if the VPS allows more. Many relay operators set BandwidthRate too low (e.g., 1 MB when the server can deliver 100 MB) out of excessive caution. This reduces the relay's usefulness to the Tor network and its consensus weight. The Tor directory authority bandwidth scanners (bandwidth authorities) measure each relay's actual throughput and set consensus weight accordingly.
Detecting VPS Provider Throttling
To determine whether a VPS provider is throttling your relay, compare Tor's internal bandwidth reports against actual system-level network statistics. Method: (1) Run a bandwidth test outside Tor: iperf3 -c a-server-outside-vps - if maximum throughput is significantly below the contracted rate, the provider is throttling. (2) Check if throttling is time-based: many providers throttle when you exceed a monthly data transfer cap. Monitor monthly usage against the contract limit. (3) Compare Tor's reported bandwidth in its logs (grep 'Bandwidth' /var/log/tor/notices.log) against node_exporter's node_network_transmit_bytes_total. If Tor reports more bandwidth than the system shows transferring, something is wrong with measurement. If system shows throttling before Tor's internal limit, the provider is throttling externally.
Optimizing BandwidthRate and BandwidthBurst Settings
Set BandwidthRate to 80% of your VPS's contract bandwidth to stay safely below the limit while maximizing relay utility. For a 1 Gbit/s VPS: BandwidthRate 100 MB (100 megabytes/second = 800 Mbit/s). Set BandwidthBurst to 120% of BandwidthRate to allow bursts without consistently exceeding the contracted limit: BandwidthBurst 120 MB. For servers with data transfer caps (monthly gigabyte limits), calculate the sustainable rate: if you have 10 TB/month limit, sustainable is 10,000 GB / 30 days / 86,400 seconds = ~3.86 MB/s = 30 Mbit/s. Set BandwidthRate accordingly. AccountingMax in torrc sets a hard monthly transfer cap: AccountingMax 9 TB with AccountingStart month 1 00:00 resets the counter monthly, automatically pausing the relay when the limit is reached.
VPS Provider Selection for High-Bandwidth Relays
VPS providers suitable for high-bandwidth Tor relays typically offer: unmetered port speeds (bandwidth is not capped by gigabyte per month but by port speed), privacy-friendly locations (Iceland, Netherlands, Finland, Czech Republic), and terms of service that permit relay operation. Data-cap-free providers charge flat monthly rates for port speed rather than transfer volume - a 100 Mbit/s unmetered port might cost $10-20/month. Providers to evaluate: Iceland-based providers (privacy-friendly jurisdiction, unmetered options), Netherlands providers (NetActuate, Leaseweb), and French providers (OVHcloud has relay-friendly policies). Check the Tor relay operators list at good-bad-isps.md in the Tor Project wiki for community feedback on specific providers' relay-friendliness.
Burst Capacity and Bandwidth Authority Interaction
Tor's bandwidth authorities test each relay's throughput periodically by establishing test circuits and measuring data transfer speed. The measured bandwidth determines the relay's consensus weight, which determines how much Tor network traffic the relay receives. If your relay has burst capacity that only activates briefly, bandwidth authorities may see different throughput in their tests than the relay's sustained rate. To maximize consensus weight: maintain consistently high bandwidth rather than burst-and-throttle behavior. Configure BandwidthRate at the level you can sustain consistently throughout the day. If your provider offers burstable bandwidth (e.g., 1 Gbit/s burst, 100 Mbit/s sustained), set BandwidthRate to the sustained rate to avoid triggering provider throttling which would drop bandwidth authority measurements.