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

worker-short-running is a memory hog #1824

Closed
jpopelka opened this issue Jan 3, 2023 · 3 comments · Fixed by #1832
Closed

worker-short-running is a memory hog #1824

jpopelka opened this issue Jan 3, 2023 · 3 comments · Fixed by #1832
Assignees

Comments

@jpopelka
Copy link
Member

jpopelka commented Jan 3, 2023

After bumping our base image to F37, the worker-short-running leaks memory and is periodically OOMKilled and restarted.

Screenshot from 2023-01-03 19-05-44

The worker-long-running is OK so it's just the multi-threaded one.

We can try the other thread pool, i.e. eventlet instead of gevent.
We can also experiment with setting some options, but they seem to be supported only by the prefork pool.

Also read through celery/celery#4843 (EDIT: that seems to apply only to prefork pool and RabbitMQ broker)

jpopelka added a commit to jpopelka/packit-service that referenced this issue Jan 3, 2023
so that we can experiment with it.

Related packit#1824
@TomasTomecek
Copy link
Member

thank you for creating this, was about to do the same :D

I stumbled upon Memory leak in run Celery Django, Gevent strategy with Multi Worker but it doesn't seem related: I couldn't find any warning in the celery startup.

softwarefactory-project-zuul bot added a commit that referenced this issue Jan 3, 2023
Install eventlet in worker

so that we can experiment with it.
Related #1824

Reviewed-by: Tomas Tomecek <tomas@tomecek.net>
Reviewed-by: Matej Focko <None>
@jpopelka
Copy link
Member Author

jpopelka commented Jan 4, 2023

I tried to give the worker a 1GiB mem limit to see if it just doesn't need more memory now and it ate all of it until oomkilled
Screenshot from 2023-01-04 10-31-58

@jpopelka
Copy link
Member Author

jpopelka commented Jan 4, 2023

I tried the eventlet pool (#1825) end there were some PostgreSQL issues so that's not a way.

F37 contains celery-5.3.0b1, while F35 had celery-5.2.6 so I built a worker image with 5.2.6 from PyPI (rpm can't be installed because of dependencies) and I'm running it on stg now.

@jpopelka jpopelka self-assigned this Jan 5, 2023
jpopelka added a commit to jpopelka/packit-service that referenced this issue Jan 6, 2023
gevent from PyPI pulls in greenlet>2.0.0 which fixes
https://bugzilla.redhat.com/show_bug.cgi?id=2158732

We can't pip install only greenlet>2 because
$ rpm -q --requires python3-gevent
python3.11dist(greenlet) < 2~~

Fixes packit#1824

And remove python3-eventlet temporarily readded with 3c8f66f
jpopelka added a commit to jpopelka/packit-service that referenced this issue Jan 6, 2023
gevent from PyPI pulls in greenlet>2.0.0 which fixes
https://bugzilla.redhat.com/show_bug.cgi?id=2158732

We can't pip install only greenlet>2 because
$ rpm -q --requires python3-gevent
python3.11dist(greenlet) < 2~~

Fixes packit#1824

And remove python3-eventlet temporarily readded with 3c8f66f
softwarefactory-project-zuul bot added a commit that referenced this issue Jan 6, 2023
Pip-install gevent & greenlet

gevent from PyPI pulls in greenlet>2.0.0 which fixes RHBZ#2158732 (Memory leak with Python 3.11)
We can't pip install only greenlet>2 because
$ rpm -q --requires python3-gevent-0:21.12.0-4.fc37.x86_64
python3.11dist(greenlet) < 2~~

Fixes #1824
And remove python3-eventlet temporarily readded with 3c8f66f
EDIT: Looks OK on staging.

Reviewed-by: Tomas Tomecek <tomas@tomecek.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants