dcrdex icon indicating copy to clipboard operation
dcrdex copied to clipboard

server needs to meter connection rate on startup

Open buck54321 opened this issue 1 year ago • 2 comments

When the server is restarted, virtually every client tries to connect at the same time, and then auth, and then request order books. This causes rate limiters to be hit and timeouts to occur. It resolves itself eventually, but it's not clean at all.

The server should limit new connection rates, returning some special response to clients when the rate limit is being exceeded, informing the clients of some delay after which they should attempt to reconnect.

buck54321 avatar Nov 08 '24 18:11 buck54321

We actually have decently restrictive rate limiters on the auth and order book subscription routes, but not on the initial connection.

buck54321 avatar Nov 08 '24 19:11 buck54321

Looking closer, this may be something different. Something taking a long time in the msgjson.ConnectRoute and causing timeouts waiting for the response.

buck54321 avatar Nov 08 '24 22:11 buck54321