-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix increased IC pod startup time when hundreds VirtualServerRoutes are used #1926
Conversation
VSR_COUNT=500 | ||
|
||
@pytest.fixture(scope="class") | ||
def vs_vsr_setup( |
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.
this function doesn't remove any created resources because k8s will remove them when the test_namespace is deleted.
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.
test_namespace
fixture is class scoped not method so if there are other tests in same class then those resources will remain until all the tests are executed.
and get_last_reload_status(metrics_url, "nginx") == "1" | ||
) | ||
|
||
assert num is None |
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 took this assert from the other tests - not fully sure though about it
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.
this is to make sure that it scaled down to 0 before starting to scale up but not necessary anymore since we've better checks now.
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.
The two new functions in custom_resource_utils.py
are not needed as there are pre-existing functions to perform those tasks.
Previously, the IC would update the status of a VSR (via an API call to the k8s API) even if the status of the VSR wasn't changed. The unnecessary API calls lead to the increased IC pod startup time for cases when a VS had multiple (hundreds) VSRs. The commit fixes the problem - the IC will skip the update if the status of a VSR isn't changed.
1601542
to
3a41c8a
Compare
Proposed changes
Previously, the IC would update the status of a VSR (via an API call to the k8s API) even if the status of the VSR wasn't changed. The unnecessary API calls lead to the increased IC pod startup time for cases when a VS had multiple (hundreds) VSRs.
The PR fixes the problem - the IC will skip the update if the status of a VSR isn't changed.
The PR includes a test that creates a VS with multiple VSRs and then checks the startup time of the pod.
The output is for 500 VSRs:
Before: gave up after 15 mins
Now: 201 seconds