Hi,
it keeps failing due to the number of connections
Are you sure it fails due to the number of connections?
I have been running a (non-exit) middle relay for some time and up until now my router has mostly coped
As the router was working until now, have you checked the number of connections have gone up? Perhaps this number of connections is not higher than before and it is failing due to other things.
I would be grateful for any advice.
Complain to the ISP, just mention them the router hangs or tell them you loose internet connection. Perhaps it is not you but them!
Personal experience: I thought I had the same problem. But luckily for me it was just pure coincidence and the issue was the ISP. My router wasn't failing, actually the ISP was failing, after some complains the ISP fixed something and now it works fine.