On 2013-05-17 at 21:38 -0700, Marc Perkel wrote:
> I'd like to be able to do this:
>
> spamd_address = 184.105.182.5${eval:${substr{-2}{1}{$tod_zulu}}%3} 783
>
> But it doesn't work. I want to do load balancing between 3 spamd servers.
(1) Per the documentation, spamd_address is only expanded if it starts
with the $ sign. So start with ${if bool{yes}{}{}} or something
simpler.
(2) Why the *HELL* do you want to deliberately create a thundering herd
failover as a persistent state of affairs? Seriously, if
spam-scanning is taking so long and spam is coming in so slowly that
changing server every second is load-balancing, you shouldn't need
so many servers that you need load-balancing in the first place.
The idea of having a pool of machines is to try to distribute the
workload fairly evenly across them (unless you're into power-saving
by keeping some number turned off or idle, but bursting into them as
needed). Sending all requests in a given second to one, then to the
next, then to the next, is ... "a very curious approach"
(3) Take a look at ${randint:3} -- for things other than spamd_address.
(4) Read the "Scanning with SpamAssassin" section of The Exim
Specification (somewhere around §43.2, depending upon your version)
very carefully. Pay careful attention to the description of the
order in which specified IPs are tried.
Given a choice between random distribution of load and coerced
thundering herd failover as a routine state of affairs, I'll take
random, any day, any time. (Now, if the spamd protocol supported load
reporting, we could implement a balanced allocations algorithm to spread
load more evenly....)