Setting max connections limit to API
Is it possible to add an option: max connections for the API port? This can be very handy for nodes going public. Would be great if this can be set in the configuration file/command line.
Let me explain why I find this important as a measure of node security:
I am seeing public nodes being hit by attackers (lots of connections to the API port). I realise that the max connections limit will not help a denial of service on the API port, but will at least keep the node's load in check, and prevent max open files from being reached (which leads to IRI crashing eventually).
In addition, I wonder if something can be done in IRI to handle dropped connections:
java 3679 iota 133u IPv4 321052 0t0 TCP 173.xxx.xxx.xxx:14265->171.xxx.xxx.xxx:43060 (CLOSE_WAIT)
These keep stacking up and I wonder if IRI (undertow?) can handle closing those orphan connections. These can cause the max open file limit to reach (4096 by default)
My node crashed 3 times running out of open files on rocks db. With enabling limiting on the api port I avoid this, however, if the attacker finds a way around it we will see nodes down again due to this issue.
we should definetly give it a try. The current situation for all node owners is no longer sustainable. https://pastebin.com/J204kXKg