Delayed Email or Message Rescans with BES 5 and Exchange 2010

Blackberry, Exchange 2010

 

I recently ran into an issue where users were reporting that messages to their Blackberry handhelds were being delivered in clumps, and were also extremely delayed.  These are symptoms of a Blackberry Server rescan.  We were running BES 5.0.2 and Exchange 2010 SP1.  We upgraded the BES to 5.0.2 MR4, but the issue remained.

This essentially means that the BES server cannot keep up with email delivery, and thus cannot deliver the emails as they arrive.  It is forced to queue them, and deliver them in chunks.

I had already configured the Exchange 2010 throttling policy as per Blackberry’s documentation:

BES 5 and Exchange 2010 Throttling Policy

So throttling wasn’t the issue.  The issue ended up being that the BES server was only creating one mailbox agent in the BES server.  This has to do with the DAG model in Exchange 2010, and the way around it is to create static mailbox agents for EVERY user, or force the BES server to create multiple mailbox agents.  We can do this with two registry keys.  The first one:

HKLMSoftwareResearch In MotionBlackberry Enterprise ServerDispatcher

If it is not there, create a DWORD named MaxUsersPerAgent and set the decimal value to the maximum number of users per agent, in my case 40 users:

Untitled

The second registry edit is:

HKLMSoftwareResearch In MotionBlackberry Enterprise ServerAgents

If it is not there, create a new DWORD with the name MaxMailboxesPerSession and set the decimal value to the value that you want the maximum number of mailboxes to be piped through a single MAPI session.  This is separate from the agent above.  For instance, I set mine to 35, which means at the 36th mailbox, the BES will create a new MAPI session.

Untitled2

After you make those changes, restart your BES server.  After making the above changes, your performance should increase, and you should see extra instances of the BlackberryAgent.exe process:

image

Just an FYI, SQL Express and MSDE are limited to five agents on the server.  For more agents, you will need to be using SQL Standard or higher, and edit the key:

HKLMSoftwareResearch In MotionBlackberry Enterprise ServerAgentsNumAgents and change its decimal value to a number higher than 5:

Untitled3

Again, this value will be ignored higher than a value of 5 on SQL Express and MSDE.  If you have 1000 users, and you set the MaxUsersPerAgent value to be 40 as above, your agent breakdown will be as follows:

BlackberryAgent (1) = 40 Users

BlackberryAgent (2) = 40 Users

BlackberryAgent (3) = 40 Users

BlackberryAgent (4) = 40 Users

BlackberryAgent (5) = 840 Users

So be careful to set the MaxUsersPerAgent value appropriately for your environment if your limited to the number of agents.

As for the BES server itself, we saw slightly higher memory utilization due to the extra agents (around 400 MB), but much lower CPU usage.

Hope you guys find this helpful!

Comments;

  1. Pingback: BES 5.0.2 and Exchange 2010 SP1 slow email delivery - Page 15

  2. Dave

    Thanks for the post! How long did it take for the additional agents to start up? We are having this exact issue with 178 BES users… So I created the keys above to limit it to 50 users per agent

    Reply
  3. Dan

    Are you sure this is HKLM? I don’t even have a Research In Motion entry under software. Or is this under HKCU?

    Thanks!

    Reply
  4. Toni Van Remortel

    For those running on a 64-bit OS: Look for HKLM/SOFTWARE/Wow6432Node/Research In Motion/BlackBerry Enterprise Server

    Reply
  5. Chris Wightman

    This did work. It reduced the delays from 1 hour for some users to either instant or a few mins.

    I have BES 5 and Exchange 2010 in a DAG so its pretty much exactly as you say.

    The only problem I have is, in task manager I can only see three BlackberryAgent.exe processes and not 5 as you say. I have set the NumAgents to 5 (already was at that though).

    For now its better but id like to try to have the agents increased if anyone have any ideas?

    Thank you again Paul for this guide

    Reply
  6. Chris Wightman

    Figured it out.

    MaxUsersPerAgent changed from 64 to 30, now got 5 BlackberryAgent.exe processes

    AND delay is down from 10 mins to 1 min.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *