3

I'm running a relay on my Raspberry Pi due to its low power consumption and simplicity, and have it set up to run headless via SSH so I can monitor it with tor-arm. My issue is that the longer my relay is running and the more Tor flags it gets, the more connections are made to my relay (mostly incoming) until it gets swamped and crashes.

For the first few days of operating my relay will have the flags Fast, HSDir, Running, V2Dir and Valid, and will average between 100 and 200 total connections perfectly fine. After three or four days it will gain the Stable flag, and that's when I will see incoming connections skyrocket; my Pi will handle 300 to 400 total connections but after that will struggle, and 500+ for an extended period will cause it to crash or reset, losing all connections and Tor flags.

Is it possible to somehow impose a limit on the total number of connections made by my relay? If I could keep the number of connections below 300, my Pi relay would always be rock solid and more worthy of the Stable flag when garnered.

I'm running Tor version 0.2.4.21.

PhraseD
  • 33
  • 3

1 Answers1

1

Tor Manual doesn't list a configuration option for limiting the connected clients. But it seems MaxAdvertisedBandwidth option can be used to reduce the number of clients by reducing the chance of being selected for a circuit (since this depends on the advertised bandwidth):

Server operators who want to reduce the number of clients who ask to build circuits through them (since this is proportional to advertised bandwidth rate) can thus reduce the CPU demands on their server without impacting network performance.

Tor FAQ entry titled Why is my Tor relay using so much memory? also suggest this configuration option for reducing the memory load:

If you still can't handle the memory load, consider reducing the amount of bandwidth your relay advertises. Advertising less bandwidth means you will attract fewer users, so your relay shouldn't grow as large[...]

So even the bandwidth is not your bottleneck, you may hopefully use this limit to keep the number of clients low.

gacar
  • 940
  • 5
  • 11