Audit Logs should be able to handle pressure #9870
Labels
-libs
Libraries: New libraries to be implemented
l-cloud-integration
Enso Cloud integration work
p-low
Low priority
For efficiency, the logs are sent on a background thread.
There can be a problem if the logs are recorded faster than the background thread is able to process them, especially as currently they are sent one-by-one.
On my machine, the round-trip for sending a log message to the cloud usually takes around 100ms but can peak at even 2s per message. This means that in good conditions the maximum throughput can be at around 10 log events per second. This seems to be okay-ish for our current use cases, but it may very easily be overwhelmed if a big operation is performed that runs a lot of queries quickly. If the operation runs for a short time, the pending logs will be queued and should be sent with some delay. The problem starts if the operation keeps running for a longer time at a too high throughput: more and more log messages will be queued and the system may be unable to keep up.
We have two values that we need to weight:
The messages are sent in background for efficiency, but if the system is overwhelmed that may lead to problems with reliability.
Solutions to consider:
/logs
endpoint to accept multiple messages in a single request.The text was updated successfully, but these errors were encountered: