adjust / rmq

Message queue system written in Go and backed by Redis
MIT License
1.57k stars 206 forks source link

About pollDuration #164

Closed hutu1st closed 7 months ago

hutu1st commented 7 months ago

Hi, my friend!

Can there be a performance issue if I set pollDuration = 0 in order to make messages consumed in a timely manner?

wellle commented 7 months ago

Well it means that the poll goroutine always be checking for new messages without any waits. This may lead to high CPU usage even though there's no work available. See also https://en.wikipedia.org/wiki/Busy_waiting

hutu1st commented 7 months ago

got it, thanks!