django-q2
django-q2 copied to clipboard
Why are there 2 workers running when I set the settings to just 1?
I set my settings to:
Q_CLUSTER = { 'workers': 1,}
But when seeing my logs, I see:
INFO Process-13e34c004f7246948616f2901f839ca5 processing ... INFO Process-68e7765c38374543a4e7f844f7534967 created task thirteen-skylark-east-tennessee from ....
So I assume there are actually 2 workers running? why?
Could you share your full Q_CLUSTER config? I have never seen that happen before.
Here it is:
Q_CLUSTER = { 'name': 'DjangoQ', 'workers': 1, 'timeout': 300, 'retry': 600, 'recycle':15, 'orm': 'default', "ack_failures": True, # do not restart failed tasks 'poll': 2, "catch_up": False, #don't repeat all missed tasks }
Oh wait, I see it now.
There are actually 4 processes running at minimum:
- Monitor (stores results from the completed tasks
- Worker (at least 1)
- Scheduler (schedules new tasks based on schedule)
- Guard (restarts workers when necessary)
In the logs you showed, there is one worker process and one scheduler process. So it looks like it's still running only one worker process.
Oh right. Looking closer, one of the workers only creates tasks, and the other processes them. Its ok then.
Is there a way to make my log more reader friendly by not showing the Process-13e34c004f7246948616f2901f839ca5 before every task? or giving the workers a shorter name?
Not right now. I think it would be cool to have a format option for logs though.
Maybe submit as an enhancement request?
Not right now. I think it would be cool to have a format option for logs though.
How would be this format option?