Mailing List Archive

mod_backhand success, and questions
Hi all. I have been able to backhand everything here, on my production
cluster. First, let me explain the scenario.

We are providing statistics to web sites using the common approach of
sending a small GIF image with lots of parameters, set cookies, and then
putting every bit of info we can in a database. Right now, we are
serving more than 10 million hits a day.

Our setup is the following:

- CoyotePoint Equalizer
- 11 machines (linux, apache, mod_backhand, fast cgi)

We are using only two machines to act as moderators, and the rest are
our second tier. So far, so good, we saw a marginal improvement on
performance without any advanced configuration scheme.



-------------------------------------------------------------
<Location /cert/hit>
SetHandler fastcgi-script
Backhand removeSelf
Backhand byAge
Backhand byRandom
Backhand byLogWindow
Backhand byLoad
</Location>

<IfModule mod_backhand.c>
BackhandConnectionPools off
UnixSocketDir /var/backhand/backhand
MulticastStats 192.168.10.31:4445,1
AcceptStats 192.168.10.0/24
</IfModule>

<Location "/backhand/">
SetHandler backhand-handler
</Location>
-------------------------------------------------------------

For the other machines, config is very similar, except in the
"MulticastStats" part, because we have added two multicaststats
directives, pointing to the two moderators:

-------------------------------------------------------------
<IfModule mod_backhand.c>
BackhandConnectionPools off
UnixSocketDir /var/backhand/backhand
MulticastStats 192.168.10.31:4445,1
MulticastStats 192.168.10.32:4445,1
AcceptStats 192.168.10.0/24
</IfModule
-------------------------------------------------------------

First, the questions:

a) I don't want that the moderator A do balancing to moderator B; how to
avoid this? (we have done it by forcing multicasting to itself)

b) We need to keep the original IP address, because is part integral of
our service (remember, we do stats). I found in early tests that if we
don't add backhand directives to every machine in the second tier, we
lose the original IP address (gets swapped with BackHandProxied). Is
this behaviour by design? Right now, we solved this by adding Backhand
directives to every machine, but it doesn't seems right, given these
machines aren't balancing anything (in fact, they are unreachable from
outside)

Second, my impressions:

For our kind of work, backhand looks like bless. In our previous setup,
we had every machine responding to requests, with lots of performance
issues. Right now, our two moderators are managing the incoming traffic
pretty well, and the CPU load and memory usage in all other machines is
nice and steady. We have solved a problem, and now we are going to use
it to do more interesting stuff by using some custom made candidacy
functions. I asked about it a couple of weeks ago, and the feedback was
very useful.

Now we have completed a first step, and are very pleased with the
results. Congratulations to the gang, keep going with this excellent job.

Regards,
--
Leonardo Herrera L.
mailto:leus@epublish.cl
mod_backhand success, and questions [ In reply to ]
On Wednesday, August 21, 2002, at 04:55 , Leonardo Herrera wrote:
> a) I don't want that the moderator A do balancing to moderator B; how
> to avoid this? (we have done it by forcing multicasting to itself)

Your way is interesting -- and pretty effective. If it works, I would
use that.

The documented way is to name the front end machines differently
(frontend-{1,2,3} and backend-{1,2,3,4} use
BackhandFromSO libexec/byHostname.so byHostname backend

It would be faster (and better) to write your own candidacy function
that does the same thing on IP addresses.

> b) We need to keep the original IP address, because is part integral of
> our service (remember, we do stats). I found in early tests that if we
> don't add backhand directives to every machine in the second tier, we
> lose the original IP address (gets swapped with BackHandProxied). Is
> this behaviour by design? Right now, we solved this by adding Backhand
> directives to every machine, but it doesn't seems right, given these
> machines aren't balancing anything (in fact, they are unreachable from
> outside)

Interesting problem. I'd have to look at why it isn't rewriting that.
mod_backhand is "supposed" to automatically put the "BackHandProxied"
header into the connection's remote ip structure. As an interesting
experiment, try putting "Backhand Off" on the backend machines and see
if it correctly populates the IP address.

You will definitely need to have a loadmodule and an addmodule line on
the backend machines as it is the mod_backhand module itself that has
the logic to pull the switcheroo in the post_read_request handler.

--
Theo Schlossnagle
Principal Consultant
OmniTI Computer Consulting, Inc. -- http://www.omniti.com/
Phone: +1 301 776 6376 Fax: +1 410 880 4879
1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7