arghyaiitb / the-tldr-tech-comments

Repository to maintain comments for thetldr.tech blog
0 stars 0 forks source link

https://thetldr.tech/how-to-perform-healthcheck-of-celery-beat/ #6

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

How to perform healthcheck of Celery beat?

https://thetldr.tech/how-to-perform-healthcheck-of-celery-beat/

cyzanfar commented 2 years ago

I'm confused. Don't you need celery beat running to kick off the periodic task you defined?

arghyaiitb commented 2 years ago

@cyzanfar yes we need celery beat for the script to run. I have already mentioned that.

Can you elaborate your question more?

cyzanfar commented 2 years ago

Right but if you need celery beat to run for your scheduled task to execute, how will the healthcheck Task run if your beat process is down?

arghyaiitb commented 2 years ago

@cyzanfar that's the point, when the celery beat process is down, it will not be able to run the task which would mean that your health check has failed. You would need to use a service that uses push health checks, something like StatusCake.

PS- A push health check service means, you have to continuously hit a given endpoint of the third party service(eg statuscake) within a given interval regularly, ie, you have to hit statuscake server every 5 min, if you skip then statuscake will notify that your service is down. In our case if celery beat is down then it would not hit the request anymore, which will trigger healthcheck failure. This is opposite to what traditional healthcheck does, where they call your service endpoint.

azin634 commented 2 years ago

Are there any open source tools to do what StatusCake is doing here?

arghyaiitb commented 2 years ago

@azin634 Not that I know of. The problem of open source hosting solution for healthcheck is, you are maintaining it and if it goes down, how will you know that it went down. I recommend using third party tools for this.