For my heroku app, the memory keeps growing, and I think it is because the number of messages sent per unit time is more than number of messages processed by the worker. How can I keep a monitor on the number of unprocessed message at any given point of time
Asked
Active
Viewed 468 times
0
-
1possible duplicate of [Retrieve list of tasks in a queue in Celery](http://stackoverflow.com/questions/5544629/retrieve-list-of-tasks-in-a-queue-in-celery) – Árni St. Steinunnarson Nov 08 '14 at 10:05
2 Answers
2
from celery.task.control import inspect
From this SO
If you need logging facilities, check out flower

Community
- 1
- 1

Árni St. Steinunnarson
- 1,580
- 11
- 20
-
Thanks, what I want is the number of messages and not the number of tasks (which inspect would give). There could be one single shared_task or PeriodicTask, but different parts of the app could call the same MySharedTask.delay() multiple times in different messages (all referring the same MySharedTask) ; or the same PeriodicTask could be fired every 1 second by the Celery Beat. I want to find out if more messages are being generated per unit time than being processed – dowjones123 Nov 10 '14 at 11:00
0
maybe you need this:
@celery.task(rate_limit='500/m')
def my_task():
url = "http://www.google.com"
r = requests.get(url)
rate_limit='500/m'
can limit your tasks to operate 500 times in one minute.

no13bus
- 347
- 1
- 4
- 15