Score:0

shutdown my EC2 when my celery worker is idle

jp flag

i have an AWS-SQS to receive message for the execute task on my celery worker which deployed on an EC2. One task takes around 5-6 min to execute. Actually i want to shutdown EC2 when there is no message in a SQS queue therefore i already setup cloudwatch + SNS + lambda to shutdown my EC2.

But issue is that sometimes it's shutdown EC2 when last task is running because cloudwatch trigger alarm to stop my EC2. so is there anyway to get status of my celery worker, whether it's idle or running ? thanks

Tim avatar
gp flag
Tim
It might be easier to simply build a fixed delay in the lambda before it shuts down. Also, if you can move your processing to lambda it may be more efficient.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.