Why limiting bandwidth on your Tor relay can stop you from browsing
If you run a relay and a client in the same Tor process, and have some bandwidth limits, once your relay hits its limit and goes into hibernation, your client connections stop too.
When you run a Tor relay and a Tor client in the same process, the parameters set in AccountingMax and BandwidthRate apply to both relay and client functions. 因此你可能会发现,一旦 Tor 进入休眠,你就不能进行浏览了,而且在日志里出现这样一条记录:
Bandwidth soft limit reached; commencing hibernation.
No new connections will be accepted
解决方案是运行两个 Tor 进程:一个中继和一个客户端,每一个进程使用自己的配置。 如果已有正常运行的中继设置,一种方法如下:
- 在中继的 Tor torrc 文件中,将SocksPort 设置为 0。
- 从 torrc.sample 创建新的客户端 torrc 文件,确保它使用的日志文件与中继不同。。 根据命名惯例,将其命名为 torrc.client 和 torrc.relay。
- 修改 Tor 客户端和中继启动脚本来包括
-f /path/to/correct/torrc。 - 在 Linux/BSD/macOS 系统中,将启动脚本改为
Tor.client和Tor.relay,这使分开配置更容易。