Symptoms
Problems with e-mails delivery to end-users - e-mails delivered with delay, sometimes up to a few hours late.
In the MSMQ queue a lot of objects sit for hours without being processed. What could be the reason for the accumulation of objects in the queue? Do accumulation affects e-mail delivery delays?
Diagnoses
Sometimes similar issues can be caused by the fact that K2 database is full, specifically the EventBus schema. As a quick check on this you can check if there are any tables in the EventBus schema that have more than 10,000 entries. This was not the case in this instance.
It is possible that such problems arise after K2 user base increase which put more load on the server and requires scaling out and performance tuning. As a a solution to slow processing MSMQ messages while K2 Server is under heavy load you can also conside the following recommendations on tuning MSMQ settings:
https://support.microsoft.com/en-us/kb/901279
https://blogs.msdn.microsoft.com/johnbreakwell/2009/02/06/optimising-performance-of-msmq-over-http/
With these settings in place delays can be reduced from hours to 2-3 minutes which should be acceptable.
If you also experience increased load on K2 server you can consider scaling out your K2 environment from one server to 2 servers in NLB cluster.
Adding in config file in certain scenarios may also reduce delays. This setting controls which methods to use for Smartactions and may gain you performance benefit when you for example switch to on-premise SMTP server instead of a provider-hosted or located in remote location server. And this is what you can do by means of changing the following entry in the K2HostServer.exe.config file from:
to
Resolution
See details above.