Calls in the queue doesn't distribute to IDLE Agents

Asterisk works fine almost all the time. But from time to time the calls last to get to the Agents (no more than 40s).
I have checked the logs, even with VERBOSE and DEBUG activated. And I don’t see no errors. The wrap up time in queues and agents is set to 1s.

I have checked with htop the CPU and Memory and it’s ok.

Do anyone have any counsel in this?

Calls look up agents.

If a comfort message is playing when an agent becomes free, the call will not pick up the agent.

If there are multiple queues, with different priorities, and shared members, the logic used to work out whether it is safe for a queue entry to use an agent can be quite complicated and may reserve agents unnecessarily for higher weight queues.