-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Backend_Cleanup Delete fest #5401
Comments
MongoDB should definitely use TTLs. I agree that the cleanup task execution time is arbitrary and should at the very least be configurable. |
As @thedrow mentioned, only certain backends require cleanup tasks, which are enqueued by Celery Beat. @AvnerCohen a few questions on your architecture:
|
@thedrow @georgepsarakis Indeed, we have tens of Beats. |
@AvnerCohen in that case, having a centralized storage for the scheduler may help. |
Yeah, in my case the solution was just to make sure there is a single beat doing that, and this solved the issue and load on the DB. I thought this is a general issue that might impact others. If not, suggest to close it. |
Brief Summary
We have a rather large production setup, with pretty large messages stored on a mongo as the backend store.
As part of the "Backend_cleanup" feature we are seeing huge load on our backend, every day at 4:00UTC, because the exact same query is executed by all workers
This was reported in the past at #4335
Proposed Behavior
To resolve this what we have done on our end, is disabled the celery_result_expires on all workers, and enabled it just in one of the workers.
The load was fixed as a result.
What we see on the mongodb is the exact same query being called from hundreds of workers, this results in an unneeded load given that this is a pretty straightforward delete query and the lock/contention on the DB is really unnecessary.
I think the following are options to fix or improve that situation, as I am sure some people see this daily load on their production system without fully knowing what is causing it.
Options to fix:
The obvious down side is that this is mongo specific (although redis can do the same).
Down side is it's a bit of black magic.
The bit can be on a date basis, such that even if something happend and it was left "ON" it will not block deletion in future days.
Happy to provide more context if anything is missing.
The text was updated successfully, but these errors were encountered: