Hello, I've been thinking about different ways of load balancing
between two SMTP servers via DNS round-robin. I can see at least two
different methods.

Method 1 - Single MX record that points to a host that resolves to
multiple IP addresses:

  # Individual SMTP servers
  local-data:     "smtp1.example.com.            IN A 10.0.5.51"
  local-data:     "smtp2.example.com.            IN A 10.0.5.52"

  # DNS round-robin for smtp.example.com via multiple A records
  local-data:     "smtp.example.com.             IN A 10.0.5.51"
  local-data:     "smtp.example.com.             IN A 10.0.5.52"

  # Single MX record that resolves to multiple IP addresses
  local-data:     "example.com.                  MX 10 smtp.example.com."


Method 2 - Multiple MX records with equal priority that point to hosts
that each resolve to a single IP address:

  # Individual SMTP servers
  local-data:     "smtp1.example.com.            IN A 10.0.5.51"
  local-data:     "smtp2.example.com.            IN A 10.0.5.52"

  # Multiple MX records
  local-data:     "example.com.                  MX 10 smtp1.example.com."
  local-data:     "example.com.                  MX 10 smtp2.example.com."


I think method No 2 is the traditional way of specifying multiple SMTP
servers in DNS. Can anyone suggest specific advantages/disadvantages
for both methods, or are they functionally the same?

PS. I tried using Postfix smtp-source, but it does not seem to support
lookup via MX records. So I could only test DNS round-robin:

for i in $(seq 1 100)
do
  smtp-source -c -l 10 -s 1 -m 1 -t [email protected] smtp.example.com:25
done

This seems to work quite well with 50/50 load distribution.
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to