08 November 2018

Exchange 2016 - Limits and impact of Transport Rules (Mailflow Rules)

Sometimes, to solve complex problems, you have to use transport rules. But what are the limitations of this functionality?
I decided to cover 2 questions:

Part 1. How big may the transport rule be?

All transport rules are stored in the "CN=TransportVersioned,CN=Rules,CN=Transport Settings,CN=<Organization>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<domain>,DC=<domain>" container. The rule itself is a XML that is stored in the "msExchTransportRuleXml" attribute.

Practice has shown that maximum size of XML is 30000 symbols. In my case, the rule consists of 1 condition (-FromScope InOrganization), 1 action (-PrependSubject '[RULE] ') and 1 exception with 1377 words.

After creating a larger rule, you will get an error "Rule 'Test big rule' is corrupt. The rule parser reports the following error at line 1, position 30001: Unexpected end of file has occurred. The following elements are not closed: contains, and, condition, version, rule. Line 1, position 30001". This rule automatically disables.


Part 2. Does transport rules affect email delivery time?

Theoretically yes, Exchange must check each email on each rule. But how many rules can you create without tangible impact on delivery time of emails?

Totally I have conducted 100 tests:

  • 20 tests for each 5 rule options: 0, 10, 50, 100 and 200 rules.
  • All rules are identicall (30 000 characters each).
  • All emails are almost identicall.
  • The "End-to-End Latency" is calculated from the average of values from header "X-MS-Exchange-Transport-EndToEndLatency".
  • Exchange Server (2016 CU11) is a test virtual server (2 core 2,3 GHz + 6 GB RAM) with one active user, without any other load.

Number of rules Number of characters Average End-to-End Latency, ms %
0 - 311 100%
10 10 x 30000 334 107%
50 50 x 30000 350 113%
100 100 x 30000 361 116%
200 200 x 30000 388 125%


Graph for clarity


Conclusions:

  • The maximum size of each rule in XML format must be less than 30001 characters.
  • The number and size of the rules affect the delivery time.
  • Impact on delivery time may be significant with high server loads.

No comments:

Post a Comment