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.