Answered DNS(MX) load balancing mechanism?????

  • Saturday, July 21, 2012 6:46 PM
     
     

    Hi Team,

    I’m testing my MTA performance with DNS(MX) load balancing mechanism which is responsible for, only to receive email from external domains.

    For that matter, I'm using Exchange server 2007 Journaling to send emails to MTAs which are configured in DNS(MX) load balancing cluster,

    Configuration settings:

    A.com:

    Exchange server 2007 Journaling(Global-all Messages) with DNS(MX) setting for Send Connectors to relay emails to B.com

    DNS forwarders: added B.com DNS address

    B.com:

    Configured with following DNS(MX) load balancing settings,

    Two MTA servers having A & MX record created with preference value 10 as shown below,

    zone file fragment:

                    IN  MX  10  mail.B.com.

    ....

    mail    IN  A       192.168.124.4

     mail   IN  A       192.168.124.5

    Issue/Query:

    The issue I’m seeing with DNS(MX) is, emails are relaying to single server only for a period time & then gets switch to the second server & vice versa..i.e. asynchronous balancing.

    e.g. if suppose in 1 minute Exchange send 1000 emails to the MTAs, then all the emails are relaying to 1st server rather distributing between both of them.

    If I run netstat command on the exchange server then it shows only one connection established with the MTA, either with 1st or 2nd server.  

    What I am looking for:

    Email traffic should get distribute equally. e.g. if exchange send 100 emails per minute to DNS(MX) load balancing MTAs, then emails should get distribute in scale of 50-50 ~ per minute, rather relaying to only one server.

    Is this a normal behaviour of DNS(MX)? or there is any workaround to distribute the load equally?

    Does exchange causing the problem as its making only 1 connection?

    Kindly suggest, if there is any other MS solution which will distribute the email traffic in 50-50~ scale?

    Thanks in advance!

All Replies

  • Monday, July 23, 2012 5:49 AM
    Moderator
     
     Answered

    Hi,

    Thank you for the post.

    The DNS(MX) round robin should work synchronously using one MX record with two A records.
    I suggest you run command below to test on mail.B.com directly:
    1. Run "nslookup mail.B.com" repeatly
    It will show the two addresses with rotated order.
    2. Run "ping mail.B.com", then run "ipconfig/flushdns", "ping mail.B.com"
    It should also rotate your mail server ip address.

    Another suggestion is to use two MX records with related A record.
            IN  MX  10  mail.B.com.
            IN  MX  10  mail1.B.com.
    mail  IN  A       192.168.124.4
    mail1 IN  A       192.168.124.5

    http://technet.microsoft.com/en-us/library/ff634392.aspx
    http://www.zytrax.com/books/dns/ch9/rr.html

    If there are more inquiries on this issue, please feel free to let us know.
     
    Regards,
    Rick Tan
    TechNet Subscriber Support
    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedbackhere.


    Rick Tan

    TechNet Community Support


  • Monday, July 23, 2012 6:56 AM
     
     Answered

    Just to add, many domains do it this way. Matter of fact, run nslookup for MX records for hotmail.com, yahoo.com, etc, and you can see it's done the same way.

    Round robin is not a perfect load balancing mechanism. It just rotates it based on client queries, and the results will vary because everyone's resolving it from a different DNS server, so the rotation is based on each specific DNS server.

    If you want a real load balancing solution, I recommend a hardware load balancer at the perimeter with one IP address and multiple internal mail servers, and the balancer will evenly rotate between them. There are a number of third party companies that offer load balancers that are supported by Microsoft, such as BigIP by F5, Barracuda, Kemp and more. The one I've used successfully is Kemp, however it doesn't scale well if you have more than 100,000 mailboxes. Otherwise, it works nicely.

    Kermp Load Balancers:
    http://www.kemptechnologies.com/us/

    Barracuda Load Balancers:
    https://www.barracudanetworks.com/ns/products/balancer_overview.php/

    BigIP by F5:
    http://www.f5.com/products/big-ip/

    .

    More on load balancers:

    Microsoft: Network Load Balancing Technical Overview
    http://technet.microsoft.com/en-us/library/bb742455.aspx

    .


    Ace Fekay
    MVP, MCT, MCITP EA, MCTS Windows 2008/R2, Exchange 2007 & Exchange 2010, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This post is provided AS-IS with no warranties or guarantees and confers no rights.

    FaceBookTwitterLinkedIn


    • Edited by Ace Fekay [MCT]MVP Monday, July 23, 2012 6:57 AM
    • Marked As Answer by Abhi28 Monday, July 23, 2012 1:28 PM
    •  
  • Monday, July 23, 2012 11:41 AM
     
     

    I’ve tried both the alternatives, it never distribute the load equally at the same time. I found DNS(MX) algorithm works in rotational manner only. There might be some other tweaks that needs to apply?

    Thanks!

  • Monday, July 23, 2012 11:43 AM
     
     
    How about MS NLB? Does NLB will distribute the email traffic in 50-50~ scale?
  • Monday, July 23, 2012 1:07 PM
     
     
    How about MS NLB? Does NLB will distribute the email traffic in 50-50~ scale?
    Yes. Please read the Microsoft link I posted.

    Ace Fekay
    MVP, MCT, MCITP EA, MCTS Windows 2008/R2, Exchange 2007 & Exchange 2010, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php

    This post is provided AS-IS with no warranties or guarantees and confers no rights.

    FaceBook Twitter LinkedIn