3 ms·
Celery tasks vs. Microservice for long running periodic tasks
NOTE: TASK = makes some rest calls to a IAAS provider, updates various tables in Mysql database
I am currently using celery to manage the task queue. We have large (500 tasks per minute) number of adhoc task requests and long running periodic tasks. After some profiling and instrumenting the workflow, the task launches is adding latencies to the background job to accomplished. Also, based on celery beat, periodic poller tasks are long running ones, taking up around 6 to 8 minutes in duration, with periodicity of 10 minutes.
In the above scenario, would it be better to move to microservice's (async i/o, leaning towards starlette) that would be listening/subscribed to topic, pulls the request, completes it, and then waits for next request. Microservice runs forever. For every periodic task (celery beat), there is a microservice replacement. planning NATS for pub/sub
What would be the best approach for a scalable architecture (from 500 per minute to 4K per minute)?