-
Type:
Task
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Repl 2023-05-29, Repl 2023-06-12, Repl 2023-08-07, Repl 2023-08-21
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
APIVersionMetrics::update tracks the last used DateTime of a given <Application Name, API Version> pair. For every request, we take a global mutex, do a two level lookup through hash tables and then update a datetime.
I surmise, that for a given client the pair of <Application Name, API Version> never changes after initial connection. For instance, with non-internal clients, Application Name can only be set on the first hello command. For internal clients (mongos -> mongod), Application Name can be changed but it is unlikely. The API Version likely also does not change during the lifetime of a connection.
To avoid the two level lookup and global lock, we could cache a handle in mongo::Client to an atomicword for date_t and then reuse that it <Application Name, API Version> has not changed.
I would expect a small perf benefit by avoiding the lock and lookups.
- depends on
-
SERVER-78391 Improve performance for API version metrics
-
- Open
-
- related to
-
SERVER-77087 Make the retention period of metrics.apiVersions configurable.
-
- Closed
-
-
SERVER-77088 Introduce a metric that lists the number of unique appNames
-
- Closed
-