busy looping qrunner keeps CPU needlessly awake
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
New
|
Wishlist
|
Barry Warsaw |
Bug Description
I just ran powertop on my mostly idle server and it seems as if mailman's various qrunner processes
keep on waking up the CPU. Mostly to see that there is nothing to do.
> Wakeups-from-idle per second : 46.5 interval: 15.0s
> no ACPI power usage estimate available
>
> Top causes for wakeups:
> 21.2% ( 7.0) python : schedule_timeout (process_timeout)
> 17.3% ( 5.7) <interrupt> : eth0
> 11.5% ( 3.8) <interrupt> : extra timer interrupt
I don't know how mailman works internaly so I can't even begin to guess it there is too short a timeout somewhere in a select() call waiting for network connections, or some thread scanning a directory.
Anyway, it keeps waking up the CPU and thus wastes a lot of energy. Don't get me wrong. It doesn't actually produce any significant CPU load, but those wakeups produce context switches, TBL flushes and in general wasted CPU cylcles that translate into wasted energy and higher latencies for those processes that may actually need the CPU.
Taking into account the number of installations that mailman has worldwide I consider this behaviour a grave bug.
This is not a bug. The queue runners sleep for QRUNNER_SLEEP_TIME when they have nothing to do The default is 1 second. If you would like them to sleep longer, set QRUNNER_SLEEP_TIME in mm_cfg.py.
Note however that this is not an interrupt driven process. The qrunners have to poll their queues, so don't set the time too long or performance will suffer.