We are using celery to run asynchronous tasks for a Django site.
The current worker setup is -pool=prefetch with --max-memory-per-child 5120000. The max memory threshold is important, because our tasks are leaking memory.
Now, we found in a recent analysis that our tasks are I/O bound and would work much better with a thread based execution pool like gevent, e.g. we can get much higher throughput.
However, neither the max-memory-per-child parameter nor the max-tasks-per-child setting are supported for thread based execution pools. The documentation says (source):
pool support: prefork
Is they any other celery configuration that could help me limit the max worker memory and/or force a worker restart after x task executions or is our only option to restart the worker with cron?