Mailing List Archive

[mod_backhand-users] Re: hi
The following is annotated...

Digital Kid wrote:
>
> Sorry to e-mail you directly with a question on mod_backhand but I could not
> find an e-mail address and I also posted to the mailing list but
> unfortunately, I'm the first one on the users-list. I was wondering if you
> would be able to help me out with configuration or point me into the right
> direction? I appreciate ANY help that you may be able to give. Here is the
> description of where I'm at after 4 days of messing around and looking for
> resources/help :
>
> 1. I have mod_backhand installed on two Linux boxes that I want to test
> out load balancing. I want to start with 2 boxes and slowly add to the
> cluster. The 2 ip addresses are 10.1.1.49 & 10.1.1.50 and here is the
> httpd.conf of the "Parent" server ( 10.1.1.49 ) :

mod_backhand doesn't foster the concept of parent servers. They are all
peers.

> <Directory "/www/cgi-bin">
> Allow Override None
> Options None
> Order allow,deny
> Allow from all
> Backhand byAge
> Backhand byRandom
> Backhand byLogWindow
> Backhand byLoad
> Backhand byCPU

This doesn't make sense. byLoad or CPU? You have it byCPU, because the
byCPU call reorders based on CPU utilization completely ignoring the
ordering set by byLoad. I would use byLoad as byCPU doesn't work well
at all.

> </Directory>
>
> IfModule mod_backhand.c>
> UnixSocketDir /www/backhand
>
> MulticastStats 10.1.1.0:4445

Assuming you have a netmask of 255.255.255.0 this should be ok, but .0
is a network address and you should really use 255, so change it to
10.1.1.255:4445

>
> AcceptStats 10.1.1.0/24
>
> <Location "/www/backhand/">
> SetHandler backhand-handler
> </Location>
> <IfModule>

This means the Location of the handler is http://host/www/backhand/, I
would take the ww out of the Location directive.

> httpd.conf of "Child" server ( 10.1.1.50 )
>
> <Directory "/www/cgi-bin">
> Allow Override None
> Options None
> Order allow,deny
> Allow from all
> Backhand byAge
> Backhand byRandom
> Backhand byLogWindow
> Backhand byLoad
> Backhand byCPU

Again... use byLoad (take out the byCPU)... Also, here and above, don't
use byRandom and byLogWindow... With two machines it effectively
randomly selects a server (2 -> 1) and the byLoad wont do anything.
Just do byAge and byLoad.

> </Directory>
>
> IfModule mod_backhand.c>
> UnixSocketDir /www/backhand
>
> # Pointing to the main server
>
> MulticastStats 10.1.1.49:4445,1

This doesn't point anywhere really. For starters 10.1.1.49 isn't an IP
multicast address, it is a normal IP. You should set this to the same
in all of your server confs.

>
> <Location "/www/backhand/">
> SetHandler backhand-handler
> </Location>
> <IfModule>
>
> When I startup apache on both servers... they have similar notices in the
> error_log :
>
> [alert] setuid: trying to ste it to 99
> [notice] mod_backhand: child at 5:591
> [notice] mod_backhand: child at 6:592

This is normal. If you find it annoying you can comment it out of the
code ;)

> 2. I am having problems configuring httpd.conf because I only want to have
> 2-3 machines to start off with but I do not know if I setup the
> MulticastStats and AcceptStats correctly. For example... I want to use
> 10.1.0.50 and 10.1.0.51 to start off... are my httpd.conf files correct? I
> am also wondering what is "backhand-handler" it's default was = "/backhand"
> which is not a directory or file.

/backhand is a Location, it is handled in the module. If you set up
/backhand as in the example httpd.conf the visit
http://localhost/backhand/ (include the trailing slash!) This will tell
you the current system utilization.

> 3. I tested the "backhand-test" script but it only shows me the server I
> hit... did not show any information for the other server so I am assuming
> that I do not have it configured correctly.

If you visit the /backhand/ (backhand-handler) and you don't see
anything or only see one machine, then it will NEVER forward. It can
only forward to the machines you see on that list.


Another issue that you should be aware of: If your machines 10.1.0.50
and 10.1.0.51 are to talk to each other, mod_backhand needs them to
believe their "main" IP address is the 10.1.0.x IP. SO, you need an
entry in /etc/hosts for 10.1.0.x for what `hostname` returns.

There are some more people on the list now (backhand-users) so post to
that ;)

Good luck with your set up!

--
Theo Schlossnagle
33131B65/2047/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7