Open rcjsuen opened 1 year ago
Hey @rcjsuen, the code you linked is a limit per IP, not an overall limit for the server. If you reach the limits per IP, you probably don't want to scale up, but rather if you hit the overall limit of connections per server instance?
If you reach the limits per IP, you probably don't want to scale up, but rather if you hit the overall limit of connections per server instance?
And how should I determine that I've hit the overall limit assuming I just have this one WebSocket server?
https://github.com/amphp/http-server/blob/b9f6a9e039dd5b9ecc224c6e46d1a410691bbdca/src/Driver/ConnectionLimitingClientFactory.php#L47-L58
We're using amphp to create a WebSocket server. We are intermittently seeing
Client denied
messages in our logs. We would like to expose the current number of active connections as a Prometheus gauge and then have Kubernetes evaluate that number to automatically scale up the number of pods so we can handle more connections.Is this currently possible or would we first need a way to collect the number of active connections from
ConnectionLimitingClientFactory
first? Alternatively, can we implement this ourselves via some kind ofcounter++
andcounter--
logic in some handler that guarantees our numbers will not get out of sync due to exceptions and miscellaneous networking errors?