-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics, Sharding
-
None
-
Fully Compatible
-
Platforms 2017-10-23, Platforms 2017-11-13
With the way that sessions management works, a periodic maintenance task runs on each node in a replica set or sharded cluster, which synchronizes the in-memory sessions state with what's persisted in the config.system.sessions collection.
In order to improve the product supportability we should include FTDC metrics for sessions management as part of the serverStatus output. This will allow interesting server behaviour changes to be correlated with executions of the sessions state maintenance task.
I propose that the following metrics be reported, under a section called sessions. All these metrics are individual for the node:
- activeSessionsCount - The number of active/cached sessions
- sessionsCollectionRefreshCount - A number, which is incremented by one every time the in-memory sessions state has been been persisted
- lastSessionsCollectionRefreshDurationMicros - The duration of the last sessions collection refresh
- lastSessionsCollectionRefreshTimestamp - The wall-clock time of when the last sessions collection refresh happened
- lastSessionsCollectionRefreshDurationEntriesRefreshed - How many entries were refreshed during the last refresh round.
- sessionsCollectionCleanupCount - A number, which is incremented by one every time sessions are being cleaned up
- lastSessionsCollectionCleanupDurationMicros - The duration of the last sessions cleanup
- lastSessionsCollectionCleanupTimestamp - The wall-clock time of when the last sessions cleanup happened
- lastSessionsCollectionCleanupEntriesCleanedUp - How many entries were cleaned up during the last round
NOTE: These statistics are particularly useful for the sharding case, where there is cross-node communication and potentially large number of sessions that could be refreshed each round, so it is acceptable that they are only present in a sharded cluster.