hibiken / asynq

Simple, reliable, and efficient distributed task queue in Go
MIT License
9.48k stars 684 forks source link

The processing delay time is too long, resulting in inaccurate timing task time #548

Open jinsuojinsuo opened 2 years ago

jinsuojinsuo commented 2 years ago

1663898862219 It is recommended to make it configurable

linhbkhn95 commented 2 years ago

@jinsuojinsuo It is delayed when all queues are empty. I think it makes sense

yousifh commented 2 years ago

I did some benchmarking around this issue here #506

It impacts the average time to execution for tasks. However lowering the sleep will increase the idle CPU usage of Redis. I also tested an alternative approach that can change the sleep period depending on how busy the queue is here. It will lower the latency of time to execution at the cost of more complicated code.

kamikazechaser commented 1 year ago

It could be added as an optional param that defaults to 1 second.

jinsuojinsuo commented 1 year ago

Why does time fluctuate

krhubert commented 1 year ago

Hey @hibiken, any chance to address this issue? It would be especially useful for speeding-up e2e tests.

I've made a PR