Celery workers missing heartbeats and getting substantial drift over Ec2

一世执手 提交于 2019-12-23 11:01:39

问题


I am testing my celery implementation over 3 ec2 machines right now. I am pretty confident in my implementation now, but I am getting problems with the actual worker execution. My test structure is as follows:

  • 1 ec2 machine is designated as the broker, also runs a celery worker
  • 1 ec2 machine is designated as the client (runs the client celery script that enqueues all the tasks using .delay(), also runs a celery worker
  • 1 ec2 machine is purely a worker.

All the machines have 1 celery worker running. Before, I was immediately getting the message:

"Substantial drift from celery@[other ec2 ip] may mean clocks are out of sync." A drift amount in seconds would then be printed, which would increase over time. I would also get messages : "missed heartbeat from celery@[other ec2 ip].

The machine would be doing very little work at this point, so my AutoScaling config in ec2 would shut down the instance automatically once it got to cpu utilization levels very low (<5%)

So to try to solve this problem, i attempted to sync all my machine's clocks (although I thought celery handled this) with this command, which was performed upon start up for all machines:

apt-get -qy install ntp
service ntp start

With this, they all performed well for about 10 minutes with no hitches, after which I started getting missed heartbeats and my ec2 instances stalled and shut down. The weird thing is, the drift increased and then decreased sometimes.

Any idea on why this is happening?

I am using the newest version of celery (3.1) and rabbitmq

EDIT: It should be noted that I am utilizing us-west-1a and us-west-1c availability zones on ec2.

EDIT2: I am starting to think memory problems might be an issue. I am using a t2.micro instance, and running 3 celery workers on the same machine (only 1 instance) which is also the broker, still cause heartbeat misses and stalls.

来源:https://stackoverflow.com/questions/26049404/celery-workers-missing-heartbeats-and-getting-substantial-drift-over-ec2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!