Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue with many tenant based features and opportunity to improve it. #6903

Open
RickFrankel opened this issue Mar 5, 2024 · 2 comments
Assignees
Milestone

Comments

@RickFrankel
Copy link

Hi,

When researching the issue with features in v13.1 we came across this piece of code (in both the async and non async versions).

values.Add(new NameValue(feature.Name, await GetFeatureValueOrNullAsync(tenantId, feature.Name) ?? feature.DefaultValue));

In our setup we have around 20-30 tenant based features. For each of these features it calls

        return _featureValueStore.GetValueOrNull(tenantId, featureName);

When you look at the featurevaluestore

var cacheItem = await GetTenantFeatureCacheItemAsync(tenantId);

We are calling
var cacheItem = await GetTenantFeatureCacheItemAsync(tenantId);

For every feature we are retrieving the entire cache of feature values for that tenant and then filtering it based on the feature asked for.

We are already implementing the per request redis cache so it improves things a bit but I feel like it is redundant to get the cache of ALL features every time for every feature.

There is a big opportunity to improve the performance here.

Thanks
Rick

@ismcagdas
Copy link
Member

@RickFrankel
Copy link
Author

Yup I mentioned that above that we do use the PerRequestRedisCache but even then that can be still a lot of calls to the HttpContext when it doesn't really need to be.

@ismcagdas ismcagdas added this to the v9.3 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants