3

I have 4 VPS servers, my plan is to use one of these VPS servers as a load balancer which sends mail received by it from another server to other 3 VPS (smtp) clients who will relay mail to the outside network.

The idea is:

        ->  VPS2
 VPS1   ->  VPS3
        ->  VPS4

I want Postfix to be used as an MTA in this configuration. Can anybody help me out in this?

All servers have CentOS 5 as their OS.

Ladadadada
  • 26,337
  • 7
  • 59
  • 90
achal tomar
  • 433
  • 3
  • 12

2 Answers2

3

You can use haproxy in tcp mode to load balance SMTP requests to the other three VPS servers. However, you will have a single point of failure which is the load balancer. Anyway, you will have the needed load balancing functionality as long as the load balancer is alive.

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • Is there any other method to do this like changes in postfix main.cf file. – achal tomar Apr 05 '12 at 09:30
  • I am not aware of such a solution using only postfix. If you don't like the idea of installing a dedicated load balancing software, you can distribute the load using DNS-based load balancing. It is reasonable, but not very effective and does not recognize the failing node. – Khaled Apr 05 '12 at 09:37
  • ok i will try this and update you. – achal tomar Apr 05 '12 at 09:43
  • DNS-based load balancing is useful but how will i authenticate mails send from the 3 VPS servers if i use this. – achal tomar Apr 05 '12 at 09:59
1

What kind of volume are we talking about here ?

One postfix machine with proper disk subsystem on modern hardware will easily do hundreds of messages per second.

One reason to use separate sending machines is to use different source IPs to increase throughput to the big email providers, but you provide no details about your intended usage of this setup.

adaptr
  • 16,576
  • 23
  • 34
  • The reason for my setup is to send 400000 mails per day and my vps servers fix a quota of the mails send so i can send only limited mails from a single postfix machine,thus by using many machines i can balance the load on a single machine to send mails. – achal tomar Apr 05 '12 at 09:56
  • 1
    If you're purely worried about **sending** emails, you could just have your sending application cycle through the three mail servers. Receiving bounce emails and responses doesn't count towards your limit does it? – Ladadadada Apr 05 '12 at 10:18
  • No i am only concerned about sending emails which are generated by a php script to the load balancing server. – achal tomar Apr 05 '12 at 10:28
  • 1
    If your VPS provider limts the messages you can send I strongly urge you to ditch them and find a better company. – adaptr Apr 05 '12 at 12:16