fireduck64/jelectrum

Feature request: User configurable limits for addresssubs

nomnombtc opened this issue · 1 comments

Hello,

First thanks for creating jelectrum, it's really much faster than the python server, which is why I am running it :)

Currently someone is doing shenanigans with my server, I am logging the numbers from event-log.txt into collectd (addresssubs, users etc) and right now someone is creating up to a million addresssubs.
https://imgur.com/0s1FwHD

Server is holding up pretty ok, but disk-io is pretty high (has only one spinning hdd drive) which leads to slow sync for users. It would be good if in future versions there could be some configurable limits per user to prevent such things.

The python server seems to have something like this, but I could not find any related documentation: https://github.com/spesmilo/electrum-server/blob/master/src/processor.py#L238

Yeah, I've noticed some similar behavior and I think such a feature makes sense.

It needs to be carefully to avoid the "user" just creating more connections, like limited subs per IP rather than connection. Or maybe just limited rate. Once they are in memory, they don't really add any load since it just a quick set check on new blocks to see if any notifications need to go out. The initial getting information to serve the initial request will have to hit disk though.

Anyways, solid feature request.