Which way is the best for running background processes?

Ali Hallaji :

On the server-side: I need a way to execute some tasks in the background, frequently and start it at a specific time. My programming language is Python for the back-end(Sanic Framework), VueJs for the front-end, MongoDB as main DB and the Redis for caching. Also, I'm using a Docker container(docker-compose). Also, I worked before with the Celery but I want to know what is the best solution for production that guarantees it's stable and reliable.

On the client-side: For the mentioned question, I need to run it on the server-side, sometimes I need to run a job scheduler on clients, embedded devices such as Raspberry Pi that could run Python or JavaScript.

So, What are your solutions for these use cases?

DejanLekic :

In production we have both long and short-running tasks and in total our Celery cluster executes up to 6M tasks per day, so naturally I would recommend Celery. It is made for this purpose and if you are a Python developer you have another reason to pick Celery. Finally, Celery is the only Python task queue system known to me that has HA scheduler (https://github.com/mixkorshun/celery-beatx and https://github.com/sibson/redbeat).

There are two other (Python) projects that should be mentioned as alternatives to Celery - Huey (https://github.com/coleifer/huey) and Apache Airflow (https://github.com/apache/airflow).

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=368465&siteId=1