en

Configuring Tor Bridge Bandwidth Rate and Relay Policy

Bandwidth configuration determines how much of your server's network capacity Tor uses and how the directory authorities measure and advertise your relay's capacity. Getting this wrong leads to either underutilizing the server or exceeding your data center's traffic allowance with unexpected overage costs. This guide covers every bandwidth-related torrc parameter, how the directory authorities measure bandwidth, and practical configurations for different hosting plan sizes.

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Understanding Tor's Bandwidth Parameters

Tor has multiple bandwidth parameters that serve different purposes. RelayBandwidthRate sets the sustained maximum throughput the relay will use. RelayBandwidthBurst allows short-term traffic above the rate limit, useful for serving burst-heavy workloads without permanently advertising lower capacity. MaxAdvertisedBandwidth sets the maximum bandwidth the relay will advertise in its descriptor, which affects how much traffic the directory authorities direct to it.

BandwidthRate (without the Relay prefix) also applies to client connections if you are running Tor as a combined client and relay. For dedicated relay VPS, use the RelayBandwidth* parameters to avoid unintended interaction with the client configuration. Setting them separately gives precise control over relay contribution independent of any local Tor usage.

AccountingMax and AccountingStart allow you to cap total monthly data usage, important if your hosting plan has a monthly transfer limit. Once AccountingMax is reached, Tor enters accounting mode and stops accepting new circuits until the accounting period resets. This prevents overage charges at the cost of reduced relay availability toward the end of the month.

Calculating Bandwidth Settings from Hosting Plan

Start from your hosting plan's network specifications. An AnubizHost Romania VPS Mini ($19.99/mo) includes 2 TB of monthly transfer on a 1 Gbps port. Calculate the sustainable bandwidth rate:

Monthly limit: 2 TB = 2,000 GB = 16,000 Gbit
Days in month: 30 x 86400 seconds = 2,592,000 seconds
Safe sustained rate: 16,000,000 Mbit / 2,592,000 / 8 = ~770 KB/s
Conservative torrc: RelayBandwidthRate 500 KB

This calculation assumes 100% relay usage for the entire month, which rarely occurs. Most relays use 30 to 60% of their theoretical maximum on average. Setting RelayBandwidthRate to 500 KB/s leaves a comfortable buffer while still providing useful capacity. Adjust upward after the first month if actual usage is well below the limit.

For plans with unmetered bandwidth (common on higher-tier plans), set RelayBandwidthRate to match 80% of the physical port speed. An unmetered 100 Mbps port sustains 80 Mbps of relay traffic indefinitely without concern about monthly caps.

Accounting Mode Configuration

AccountingMax and AccountingStart protect against overage charges on capped bandwidth plans. Configure in torrc:

AccountingMax 1500 GB
AccountingStart month 1 00:00
AccountingRule sum

AccountingMax 1500 GB on a 2 TB plan leaves 500 GB buffer for OS updates, monitoring traffic, and normal administrative use. AccountingStart month 1 00:00 resets the accounting window at midnight on the first day of each month, matching typical hosting billing cycles. AccountingRule sum counts both incoming and outgoing traffic toward the limit; AccountingRule max counts only the larger of the two, which is more favorable for relay operators.

When Tor enters accounting mode, it logs the event and stops accepting new circuits. Existing circuits complete normally. A relay in accounting mode for 3 to 5 days per month loses approximately 10 to 16% of its uptime, which reduces its consensus weight. If accounting mode triggers frequently, either increase RelayBandwidthRate limits or upgrade to a plan with more monthly transfer.

Traffic Shaping to Protect Other Services

If you run other services on the same VPS alongside the Tor relay, use Linux traffic control (tc) to prevent Tor from saturating the network link and degrading those services. Create a tc qdisc that limits the tor process's socket traffic:

tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 80mbit burst 10mbit
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 20mbit burst 5mbit
tc filter add dev eth0 parent 1: protocol ip u32 match ip sport 9001 0xffff classid 1:10
tc filter add dev eth0 parent 1: protocol ip u32 match ip dport 9001 0xffff classid 1:10

This configuration limits Tor relay traffic (ORPort 9001) to 80% of available bandwidth while guaranteeing 20% for all other services. Adjust the bandwidth percentages to match your specific requirements. Combine with torrc RelayBandwidthRate settings for defense in depth: the torrc limit prevents Tor from attempting to exceed its allocation, and the tc filter enforces it at the network level regardless of Tor configuration.

Why Anubiz Host

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.

Anubiz Chat AI

Online