UserOfficeProject / issue-tracker

Shared place for features and bugs from all collaborators.
0 stars 0 forks source link

Review UOWS caches #1099

Open ACLay opened 1 month ago

ACLay commented 1 month ago

What is the problem and why is it a problem

The UOWS is seeing large volumes of traffic from us, potentially causing errors. It appears that our caching is insufficient for the number of users being processed, as the number of requested users is massively higher than the cache size, so a lot of refetches will be performed.

We suspect we're only seeing this now as this is the first time FAP meetings are being held in the software at ISIS.

A selection of recent cache statistics:

 {"cache":"uowsBasicUserDetailsCache","stats":{"hits":41381,"misses":8223,"additions":166,"updates":5328,"removals":166,"entries":166,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsSearchableBasicUserDetailsCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsRolesCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsBasicUserDetailsCache","stats":{"hits":8,"misses":4,"additions":0,"updates":0,"removals":4,"entries":1,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsSearchableBasicUserDetailsCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsRolesCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsBasicUserDetailsCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":200,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsSearchableBasicUserDetailsCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsRolesCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":0,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsBasicUserDetailsCache","stats":{"hits":3781,"misses":1427,"additions":615,"updates":285,"removals":690,"entries":125,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsSearchableBasicUserDetailsCache","stats":{"hits":0,"misses":0,"additions":0,"updates":0,"removals":0,"entries":1,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsRolesCache","stats":{"hits":0,"misses":2,"additions":2,"updates":0,"removals":2,"entries":84,"maxEntries":200},"loggingFrequencySeconds":300}
 {"cache":"uowsTokenCache","stats":{"hits":162,"misses":68,"additions":9,"updates":51,"removals":8,"entries":113,"maxEntries":200},"loggingFrequencySeconds":300}

Steps to reproduce (if it's a bug).

ACLay commented 1 month ago

Also to consider, would it be worth switching to something like https://www.npmjs.com/package/@isaacs/ttlcache so we don't have to deal with cache sizes? What's most appropriate for our use cases?

simonfernandes commented 1 month ago

Sprint planning notes:

@ACLay Is this something you were planning to work on, or are you just raising it for now?

ACLay commented 1 month ago

I'm not planning on doing it imminently, just tracking for now and added to our sprint boards.