What feature do you want to improve?
In 3.8.0 we added a feature to warn when replicating too many docs. This warning is shown when creating a new user, when that user logs in for the first time, and then shown in the API logs every hour the user attempts to replicate.
This is useful but unless people are monitoring the logs closely is likely to be missed.
Describe the improvement you'd like
- Extend the new monitoring endpoint to include the number of users replicating too many docs.
- Provide a method of finding which users are replicating too many docs so they can be investigated. This could be a new API or an addition to the monitoring API JSON format response.
The easiest way to implement this is to extend the existing logging code so instead of refreshing the cache each hour it retains the logins for longer (perhaps 7 days). This may require persistence (eg: in a _local couch doc) so that it's maintained between restarts, particularly if the heavy user is crashing API.
An alternative implementation would be to query the telemetry docs which include the number of docs locally. This data will always be a little out of date (telemetry is synced monthly) and only works for users who have successfully synced at least once so wouldn't include a user whose replication is constantly failing.
Once the monitoring code is in place it may no longer be necessary to log this information.
Once the endpoint is done consider including a warning in the users page of the admin app, or raising an issue to tackle this in a later release.
Describe alternatives you've considered
We could provide a script to query couch and find this information, but it's quite a heavy operation so to run it for all users could be expensive. By recording the information when the user logs in it's essentially free.
What feature do you want to improve?
In 3.8.0 we added a feature to warn when replicating too many docs. This warning is shown when creating a new user, when that user logs in for the first time, and then shown in the API logs every hour the user attempts to replicate.
This is useful but unless people are monitoring the logs closely is likely to be missed.
Describe the improvement you'd like
The easiest way to implement this is to extend the existing logging code so instead of refreshing the cache each hour it retains the logins for longer (perhaps 7 days). This may require persistence (eg: in a
_localcouch doc) so that it's maintained between restarts, particularly if the heavy user is crashing API.An alternative implementation would be to query the telemetry docs which include the number of docs locally. This data will always be a little out of date (telemetry is synced monthly) and only works for users who have successfully synced at least once so wouldn't include a user whose replication is constantly failing.
Once the monitoring code is in place it may no longer be necessary to log this information.
Once the endpoint is done consider including a warning in the users page of the admin app, or raising an issue to tackle this in a later release.
Describe alternatives you've considered
We could provide a script to query couch and find this information, but it's quite a heavy operation so to run it for all users could be expensive. By recording the information when the user logs in it's essentially free.