Browse Source

Sleep only 0.2s not 1s after empty queue (round-trip time went from 0.03s to 0.01s, without hammering CPU)

Ask Solem 15 years ago
parent
commit
c30bebe09d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/worker/controllers.py

+ 1 - 1
celery/worker/controllers.py

@@ -88,7 +88,7 @@ class Mediator(BackgroundThread):
             # This blocks until there's a message in the queue.
             task = self.ready_queue.get(timeout=1)
         except QueueEmpty:
-            time.sleep(1)
+            time.sleep(0.2)
         else:
             if task.task_id in revoked: # task revoked
                 task.on_ack()