Frage

I want to retrieve information from an Excachange Server (2010 via EWS API). In detail I want build a windows service to iterate over all excachange users and index their private mailboxes using impersonalisation. That works well but its very slow when I do this one user after another (depending on the mailbox volume and the amout of users). The indexing speed is now about 500 items per minute.

The following calls takes about 250 milliseconds on my test system:

PropertySet myPropertySet = new PropertySet(BasePropertySet.FirstClassProperties,    ItemSchema.ParentFolderId);
myPropertySet.RequestedBodyType = BodyType.Text;
myPropertySet.Add(entryIdExtendedProperty);
Item item = Item.Bind(es, itemKey, myPropertySet); 

So my idea was to do a parallelization. So far I tried 3 ways:

  1. Background worker: One worker thread per user. Result: No effect. It seems that doing this will slow down very call. In sum the overall speed stays the same.

  2. Separate EXE processes: One EXE per user. I created a "Worker"-Exe and called them with the user as argument: IndexWorker.exe -user1
    Result: Same result! The calls of every exe are slowed down!

  3. Separate Windows Services: One service per user. Result: Suddenly, the request did not slow down, which means I could bring the overall speed to a multiple of 500 items per minute (I triet up to 3 processes, thats 1500 items per minute). Not bad but I lets me alone with the question:

Why are EWS calls slowed down in 1) and 2) but not in 3)? Threading would the most elegant way for me, is there any option oder setting that I may use?

I read a couple of things about Throttling Policies and the EWSFindCountLimit. Is this the right direction?

War es hilfreich?

Lösung

Did you get to the bottom of why the separate service gave you such an increase in performance? The throttling is applied at the Service Account level, so it should not matter where you are making the calls from.

Andere Tipps

Your issue is the throttling policy. You need to create a throttling policy for your service account that doesn't restrict EWS or RPC activity.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top