You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the Token is cached inside an RwLock inside the TokenHandler and used at least once on every route for user token validation and thus might degrade API performance. There are multiple options to improve this:
Use a long-lived admin token, like 100 years, infinite life-time is not allowed unfortunately.
Use an external cache like Redis.
Use more advanced in-memory caching, like initializing a global token variable via OnceCell and then use a cached function to retrieve (and update) this variable.
I'm not the biggest fan of introducing another external dependency like Redis here, but sooner or later it might come in anyway. The long-lived token is the sledgehammer solution, simple and effective, and could at least be a temporary fix. The advanced in-memory caching is interesting since it doesn't change the way we use tokens, but at not introducing any external cache.
Before really implementing this one should probably also consider how much the RwLock actually matters in terms of performance in comparison to the Openstack API call it is used for.
The text was updated successfully, but these errors were encountered:
At the moment the
Token
is cached inside anRwLock
inside theTokenHandler
and used at least once on every route for user token validation and thus might degrade API performance. There are multiple options to improve this:OnceCell
and then use a cached function to retrieve (and update) this variable.I'm not the biggest fan of introducing another external dependency like Redis here, but sooner or later it might come in anyway. The long-lived token is the sledgehammer solution, simple and effective, and could at least be a temporary fix. The advanced in-memory caching is interesting since it doesn't change the way we use tokens, but at not introducing any external cache.
Before really implementing this one should probably also consider how much the
RwLock
actually matters in terms of performance in comparison to the Openstack API call it is used for.The text was updated successfully, but these errors were encountered: