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

Clear methods when Gunicorn worker exits #3018

Merged
merged 7 commits into from
Mar 5, 2021

Conversation

adriangonz
Copy link
Contributor

What this PR does / why we need it:

Clear the internal Python server metrics when a Gunicorn worker exists. Otherwise, the internal dictionary keeps growing, causing a high memory usage in the server itself and other downstream issues in Prometheus.

Which issue(s) this PR fixes:

Fixes #2873

Special notes for your reviewer:

Only the entries relevant to a worker process will be cleared.

Does this PR introduce a user-facing change?:

NONE

@adriangonz
Copy link
Contributor Author

/cc @axsaucedo @RafalSkolasinski

@seldondev seldondev requested a review from axsaucedo March 5, 2021 09:34
Adrian Gonzalez-Martin added 2 commits March 5, 2021 09:42
@RafalSkolasinski
Copy link
Contributor

/test notebooks
/test integration

Copy link
Contributor

@RafalSkolasinski RafalSkolasinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

Just have a few minor questions, see inlines.

python/seldon_core/metrics.py Outdated Show resolved Hide resolved
python/tests/test_gunicorn_utils.py Show resolved Hide resolved
python/tests/test_gunicorn_utils.py Show resolved Hide resolved
@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RafalSkolasinski

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RafalSkolasinski
Copy link
Contributor

Also the lint is failing

@seldondev seldondev merged commit 18a2c68 into SeldonIO:master Mar 5, 2021
@anggao
Copy link
Contributor

anggao commented Mar 5, 2021

Thanks! This looks great I will test it next week!

@RafalSkolasinski
Copy link
Contributor

For some reason tests were again triggered twice. I see one set of integration and notebooks to passed:
image

@seldondev
Copy link
Collaborator

@adriangonz: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
notebooks af97eda link /test notebooks
integration af97eda link /test integration

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make custom metrics work with gunicorn reload
4 participants