-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat(limits): Add limits to features, segments and segment overrides #2480
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
1d92ef0
to
4551fde
Compare
4551fde
to
8c7d571
Compare
A few things here:
Here are some statistics from some of our larger environments: ![]() ... and the statistics from the top users of segments: ![]() ... and the statistics from the top users of features: ![]() ... and the statistics from the top users of segment overrides ![]() Based on this, I would say that we can increase the limits you have mentioned here to perhaps:
Obviously these statistics all depend heavily on what the values for these features are. Large JSON documents will of course cause an issue. Thoughts please @dabeeeenster @gagantrivedi |
api/features/serializers.py
Outdated
def validate_environment_segment_override_limit( | ||
self, environment: Environment | ||
) -> None: | ||
if ( | ||
environment.feature_segments.count() | ||
>= settings.MAX_SEGMENT_OVERRIDE_ALLOWED | ||
): | ||
raise serializers.ValidationError( | ||
{ | ||
"environment": "The environment has reached the maximum allowed segments overrides limit." | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling we may also need to add this to the SimpleFeatureStateSerializer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that deal with segment override, right? Unless we want to limit identity overrides?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, yeah - it's how the UI used to manage segment overrides before we added the endpoint to do it in a single call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this in another PR, I'd like to test this in staging and release it asap.
I think in an ideal world I would want to build the document on every update (for edge project) and see if it still under the dynamo limit |
Hmm... yes, that's going to be way too resource intensive though so I think we need to just implement sensible limits here and deal with the edge cases as they happen. This should at least prevent anyone from generating an environment document that exceeds the memory limits of the task processor instances. |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
Limit number of segments, segment override and feature using environment variables
How did you test this code?
Adds unit test cases