[exim-dev] [Bug 2694] New: Wrong distribution to spamd-serve…

Góra strony
Delete this message
Reply to this message
Autor: admin
Data:  
Dla: exim-dev
Temat: [exim-dev] [Bug 2694] New: Wrong distribution to spamd-servers
https://bugs.exim.org/show_bug.cgi?id=2694

            Bug ID: 2694
           Summary: Wrong distribution to spamd-servers
           Product: Exim
           Version: 4.94
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Content Scanning
          Assignee: tom@???
          Reporter: heiko@???
                CC: exim-dev@???


Created attachment 1362
--> https://bugs.exim.org/attachment.cgi?id=1362&action=edit
0001-Fix-weight-calculation-for-spamd_address.patch

I have six SpamAssassin servers and I want to distribute the requests evenly
across them. I assumed the following would do this:

spamd_address = server1 783 : server2 783 : server3 783 : server4 783 : server5
783 : server6 783

But that was not the case. Instead, the distribution was as follows:

    server1 33.3%
    server2 16.6%
    server3 16.6%
    server4 16.6%
    server5 16.6%
    server6 0.0% (never got a request!)


If weight = 1 is explicitly set for all servers, which should be the default,
the result is the same. After a little experimentation, weight always seems to
be 1 too big for the first server and 1 too small for the last server. In fact,
I get even distribution across all servers if I configure the following:

spamd_address = server1 783 weight=1 : \
                server2 783 weight=2 : \
                server3 783 weight=2 : \
                server4 783 weight=2 : \
                server5 783 weight=2 : \
                server6 783 weight=3


It works, but it's unintuitive and ugly. The calculation of weight introduced
with the fix of bug 670 (commit dc7b3d3) seems to be wrong. The first patch in
the attachments corrects this.

With the fix of bug 1720 (commit 7f06582) a comparable calculation was
introduced for socks proxies (with code duplication) with probably the same
error. The second patch in the attachments corrects this.

Both functions should also use random_number() instead random(). This function
already exists in Exim, is faster, suitable for testing due to fixed seed, used
by Exim for similar purposes and it provides enough randomness. The third patch
in the attachments changes this.

The fourth patch in the attachments introduce SPAMD_PRIORITY analogously to
SOCKS_PRIORITY because of consistency.

--
You are receiving this mail because:
You are on the CC list for the bug.