The query used to get next task to processed can take a lot of time when the number of task is big (for instance, when there 1000 tasks, it can take 30 seconds).
Example of log :
2016.01.07 09:08:21 TRACE web[sql] time=18375ms | sql=select cq.uuid from ce_queue cq where cq.status='PENDING' and not exists( select 1 from ce_queue cq2 where cq.component_uuid=cq2.component_uuid and cq2.status <> 'PENDING' ) order by cq.created_at asc, cq.id asc
Technical details :
The solution is to add an index on CE_QUEUE.COMPONENT_UUID :
CREATE INDEX ce_queue_cpt_uuid ON ce_queue (component_uuid)