Discussion:
double startup ?
. TELAMON
2004-05-05 13:07:02 UTC
Permalink
Hello,

I am, at present, testing mod_backhand for Load Balancing.

I have written something like a "mod_perl servlet" and its behaviour has changed since I have installed mod_backhand : it seems like ih all the HTTP request were executed twice.

I think that this problem is due to the fact that mod_backhand is started twice as shown in the logs/error_log of Apache :

[Wed May 5 15:03:53 2004] [info] mod_unique_id: using ip addr 127.0.0.1
[Wed May 5 15:03:53 2004] [info] created shared memory segment #1277963
[Wed May 5 15:03:53 2004] [notice] mod_backhand -- UnixSocketDir set to /home/apache/backhand
[Wed May 5 15:03:53 2004] [notice] mod_backhand -- Broadcast 127.0.0.1:4445 added
[Wed May 5 15:03:53 2004] [notice] mod_backhand -- Multicast accept 127.0.0.0/24
[Wed May 5 15:03:54 2004] [notice] backhand_init(19628) spawning moderator (PID 19641)
[Wed May 5 15:03:54 2004] [notice] mod_backhand moderator ready to go
[Wed May 5 15:03:54 2004] [info] mod_unique_id: using ip addr 127.0.0.1
[Wed May 5 15:03:55 2004] [info] created shared memory segment #1310732
[Wed May 5 15:03:55 2004] [notice] mod_backhand -- UnixSocketDir set to /home/apache/backhand
[Wed May 5 15:03:55 2004] [notice] mod_backhand -- Broadcast 127.0.0.1:4445 added
[Wed May 5 15:03:55 2004] [notice] mod_backhand -- Multicast accept 127.0.0.0/24
[Wed May 5 15:03:55 2004] [notice] backhand_init(19642) spawning moderator (PID 19643)
[Wed May 5 15:03:55 2004] [notice] mod_backhand moderator ready to go
[Wed May 5 15:03:55 2004] [info] created shared memory segment #1343501
[Wed May 5 15:03:55 2004] [notice] Apache/1.3.29 (Unix) mod_perl/1.29 mod_backhand/1.2.2 configured -- resuming normal operations
[Wed May 5 15:03:55 2004] [info] Server built: May 5 2004 15:00:55
[Wed May 5 15:03:55 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)


I am running Linux Fedora Core 1, this is my compilation/installation od mod_backhand/Apache :


# cd /tmp
# tar xvzf apache_1.3.29.tar.gz
# tar xvzf mod_backhand-1.2.2.tar.gz
# tar xvzf mod_perl-1.0-current.tar.gz
# cd mod_perl-1.29/
# perl Makefile.PL APACHE_SRC=../apache-1.3.29/src PREP_HTTPD=1 DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
# make
# make install
# cd ../mod_backhand-1.2.2/
# ./precompile ../apache_1.3.29/
# cd ../apache_1.3.29/
# ./configure --prefix=/home/apache/ --enable-module=so \
--enable-module=rewrite --enable-shared=rewrite \
--enable-module=status --enable-shared=status \
--enable-module=backhand --enable-shared=backhand \
--enable-module=unique_id --activate-module=src/modules/perl/libperl.a
# make
# make install


And my httpd.conf :

<Directory /usr/local/Bus_data/>
AllowOverride None
Options None
Order allow,deny
Allow from all
Backhand byAge 6
Backhand byRandom
Backhand byLogWindow
Backhand byCPU
</Directory>

<IfModule mod_backhand.c>
UnixSocketDir /home/apache/backhand
MulticastStats 127.0.0.1:4445
AcceptStats 127.0.0.0/24

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


Do you have any ideas ?

Thank you by advance


Aymeric Masson
Theo Schlossnagle
2004-05-05 13:17:20 UTC
Permalink
Post by . TELAMON
Hello,
I am, at present, testing mod_backhand for Load Balancing.
I have written something like a "mod_perl servlet" and its behaviour has changed since I have installed mod_backhand : it seems like ih all the HTTP request were executed twice.
Likely not.
Post by . TELAMON
<IfModule mod_backhand.c>
UnixSocketDir /home/apache/backhand
MulticastStats 127.0.0.1:4445
AcceptStats 127.0.0.0/24
Balancing on localhost? What is it that you hope to accomplish? I'll
assume your just testing things.
Post by . TELAMON
Do you have any ideas ?
Yes. mod_perl hooks directly into the Apache module hook API. Module
hooks get called during every phase of the request _AND_ all sub
requests. mod_backhand makes a benign subrequest to determine how
Apache would have treated the request (transforms, etc) then makes a
balancing decision. If you have any hooks other than "handler", they
could get called more than once (this isn't only induced by
mod_backhand, other modules do this too). If you are only using
"handler", I think it is still possible, but I'd have to look into it more.

$r->is_initial_req should give you some insight as to whether this is
the "initial" Apache::Request for this HTTP request or not.
--
// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// Postal Engine -- http://www.postalengine.com/
// Ecelerity: fastest MTA on Earth
. TELAMON
2004-05-05 14:19:58 UTC
Permalink
Thank your for your fast answer

1) Yes, I'm balancing on my localhost just for tests

2) I'm just using "handler" in my hook module. Indeed, $r->is_initial_req gave me some informations : the initial HTTP requests are not any more "initial" whith mod_backhand. In fact, I use this information in order to set Session Id when the client asks the Web Application for the first time. So I try to rewrite my hook module but the double call is still here : a first session id is created but not used, then a second session id is created and used (unused means here that $r->header_out(Location => + return HTTP_MOVED_TEMPORARILY() is not effective)


It is likely because my "mod_perl servlet" is not compatible with mod_backhand (maybe because of the strange way I manage session : I rewrite the initial URL http://www.foo.com/my_page in http://www.foo.com/id_session/my_page and I'm using Apache::Session::File or Apache::Session::Oracle). It's a pity because mod_backhand is exactly what I need.

Any help, of course, is much appreciated


Aymeric Masson
Message du 05/05/04 15:17
Objet : Re: [m_b_users] double startup ?
Post by . TELAMON
Hello,
I am, at present, testing mod_backhand for Load Balancing.
I have written something like a "mod_perl servlet" and its behaviour has changed since I have installed mod_backhand : it seems like ih all the HTTP request were executed twice.
Likely not.
Post by . TELAMON
<IfModule mod_backhand.c>
UnixSocketDir /home/apache/backhand
MulticastStats 127.0.0.1:4445
AcceptStats 127.0.0.0/24
Balancing on localhost? What is it that you hope to accomplish? I'll
assume your just testing things.
Post by . TELAMON
Do you have any ideas ?
Yes. mod_perl hooks directly into the Apache module hook API. Module
hooks get called during every phase of the request _AND_ all sub
requests. mod_backhand makes a benign subrequest to determine how
Apache would have treated the request (transforms, etc) then makes a
balancing decision. If you have any hooks other than "handler", they
could get called more than once (this isn't only induced by
mod_backhand, other modules do this too). If you are only using
"handler", I think it is still possible, but I'd have to look into it more.
$r->is_initial_req should give you some insight as to whether this is
the "initial" Apache::Request for this HTTP request or not.
--
// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// Postal Engine -- http://www.postalengine.com/
// Ecelerity: fastest MTA on Earth
_______________________________________________
backhand-users mailing list
http://lists.backhand.org/mailman/listinfo/backhand-users
Loading...