Mailing List Archive

[mod_backhand-users] strange problems
Hi,

i'm pretty new with mod_backhand ... i've now having about 8 hours
backhand-installation behind me, but it won't work. I already looked through
the list-archives, i found many useful conversations but currently i'm
struggling with a problem i didn't found in the archives or via google. I
hope you can help me out ...

That's the situation:

Server 1 - 172.16.44.3, Netmask 255.255.0.0 - Pentium III (Coppermine)
httpd.conf
----------
UnixSocketDir /usr/local/httpd/backhand
MulticastStats 172.16.255.255:4445
AcceptStats 172.16.44.0/24

<Directory "/usr/local/httpd/htdocs">
...
<IfModule mod_backhand.c>
Backhand byAge
Backhand byRandom
Backhand byLogWindow
Backhand byLoad
</IfModule>
</Directory>

Server 2 - 172.16.44.4, Netmask 255.255.0.0 - Compaq ds20e / Alpha EV67
httpd.conf
----------
UnixSocketDir /usr/local/httpd/backhand
MulticastStats 172.16.255.255:4445
AcceptStats 172.16.44.0/24

<Directory "/usr/local/httpd/htdocs">
...
<IfModule mod_backhand.c>
Backhand byAge
Backhand byRandom
Backhand byLogWindow
Backhand byLoad
</IfModule>
</Directory>

mod_backhand is compiled as shared module via --enable-backhand
& --enable-shared into Apache ... and exactly 1:1 on both maschines (the
httpd.conf-File is also 100% equal).

So ... two things:

1)
after hours of trying the two maschines got knowing each other via
/backhand/ ... they are both grey (one dark, one light) ... no red one (i
guess that's good) ... but ...

on Server 1 it looks like:
Entry Hostname Age Address Total Mem Avail Mem # ready servers/# total
servers ~ms/req [#req] Arriba # CPUs Load/HWM CPU Idle
0 server1 0 172.16.44.3:80 500 MB 434 MB 0/0 0 [0] 764515 2 0.000/1 0.986
1 server2 1 0.0.0.80:0 0 MB 748 MB 283073/0 0 [719819968] 0 997 0.000/0
1.000

It doesn't seem to me that 0.0.0.0:80, total mem of 0 MB and on the other
hand 748 MB free and 997 CPUs is a correct value :-)

on Server 2 it looks like:
Entry Hostname Age Address Total Mem Avail Mem # ready servers/ # total
servers ~ms/req [#req] Arriba # CPUs Load/HWM CPU Idle
0 server2 0 172.16.44.4:80 748 MB 686 MB 0/0 0 [0] 283073 1 0.000/1 0.997
1 server2 0 172.16.44.3:11267 434 MB 0 MB 0/0 0 [0] 0 524734464 1.000/1
0.002

What's going wrong here ?

2)
When i use the following (as i read in many archived mails)

<Directory "/usr/local/httpd/htdocs">
...
<IfModule mod_backhand.c>
Backhand byAge
Backhand byRandom
</IfModule>
</Directory>

Server 2 gets the following line in the error_log when i try to access
/backhand/:
[notice] child pid 26942 exit signal Floating point exception (8)

I hope you have a tip or solution for my problem.

Thx in advance & kind regards,
Andreas de Pretis
[mod_backhand-users] strange problems [ In reply to ]
On Thursday, December 13, 2001, at 07:47 PM, Andreas de Pretis wrote:
> i'm pretty new with mod_backhand ... i've now having about 8 hours
> backhand-installation behind me, but it won't work. I already looked
> through
> the list-archives, i found many useful conversations but currently i'm
> struggling with a problem i didn't found in the archives or via
> google. I
> hope you can help me out ...
>
> 0 server1 0 172.16.44.3:80 500 MB 434 MB 0/0 0 [0] 764515 2 0.000/1
> 0.986
> 1 server2 1 0.0.0.80:0 0 MB 748 MB 283073/0 0 [719819968] 0 997
> 0.000/0
> 1.000

Looks like a 64 bit problem. time_t is probably not the same on both
machines. 32bit on ix86 and 64bits on Alpha. I happen to have a a dual
ev67 here (like the ds20) and a few intel machines. The Alpha's work
great together and the Intel's work great together. I haven't done much
testing (read: any) with a mixed cluster in a long time.

This should be a very easy problem to fix. I'll look into it now.

--
Theo Schlossnagle
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
[mod_backhand-users] strange problems [ In reply to ]
On Thursday, December 13, 2001, at 07:47 PM, Andreas de Pretis wrote:
> Server 1 - 172.16.44.3, Netmask 255.255.0.0 - Pentium III (Coppermine)
> Server 2 - 172.16.44.4, Netmask 255.255.0.0 - Compaq ds20e / Alpha EV67

Can you check ou the CVS version and try that. I have adjusted it so
that I get the same structure layout on my ev67 and my PIII machines.
It should work.

Note that this version _WILL NOT_ run in a cluster over 1.2.1 and below
mod_backhand machines.

Let me know if this works for you...
The diff, between CVS and the 1.2.1 release is below (if you don't want
to do a checkout)

--
Theo Schlossnagle
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


Index: back_util.c
===================================================================
RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v
retrieving revision 1.17
diff -u -r1.17 back_util.c
--- back_util.c 2001/10/30 19:53:47 1.17
+++ back_util.c 2001/12/14 07:02:06
@@ -73,7 +73,7 @@
return i;
return -1;
}
-int new_session(struct sockaddr_in *sin) {
+int new_session(unsigned int address, unsigned short port) {
int nsd;
struct sockaddr_in sain;
nsd = socket(AF_INET, SOCK_STREAM, 0);
@@ -94,7 +94,8 @@
}
}
#endif
- sain = *sin;
+ sain.sin_addr.s_addr = address;
+ sain.sin_port = port;
sain.sin_family = AF_INET;
if(connect(nsd, (struct sockaddr *)&sain, sizeof(struct
sockaddr_in))<0) {
if(loglevel & MBLL_NET3) {
@@ -118,7 +119,9 @@
}
for(j=0;j<MAXSESSIONSPERSERVER && rfd<0;j++)
if(connection_pool[i][j].fd<0) {
- connection_pool[i][j].fd = new_session(&serverstats[i].contact);
+ connection_pool[i][j].fd =
+ new_session(serverstats[i].contact.sin_addr.s_addr,
+ serverstats[i].contact.sin_port);
connection_pool[i][j].pid = pid;
rfd=connection_pool[i][j].fd;
/* do this because keeping track is REALLY complicated */
Index: mod_backhand.c
===================================================================
RCS file: /storage/cvs/jesus/mod_backhand/mod_backhand.c,v
retrieving revision 1.45
diff -u -r1.45 mod_backhand.c
--- mod_backhand.c 2001/11/23 22:54:51 1.45
+++ mod_backhand.c 2001/12/14 07:02:07
@@ -622,7 +622,8 @@
goto local_handle;
}
if(usepool == MBCP_OFF) {
- mbcs = new_session(&serverstats[remote_machine.id].contact);
+ mbcs =
new_session(serverstats[remote_machine.id].contact.sin_addr.s_addr,
+
serverstats[remote_machine.id].contact.sin_port);
} else {
memcpy(mbcsp_request+1,
&serverstats[remote_machine.id].contact.sin_addr,
Index: serverstat.h
===================================================================
RCS file: /storage/cvs/jesus/mod_backhand/serverstat.h,v
retrieving revision 1.5
retrieving revision 1.7
diff -u -r1.5 -r1.7
--- serverstat.h 2000/04/08 05:12:51 1.5
+++ serverstat.h 2001/12/14 06:55:55 1.7
@@ -18,8 +18,16 @@

/* General information concerning the server and this structure */
char hostname[40]; /* or truncated hostname as the case may be */
- time_t mtime; /* last modification of this stat structure */
- struct sockaddr_in contact; /* the associated inet addr + port */
+ union {
+ time_t __mtime; /* last modification of this stat structure */
+ char __pad[8];
+ } _mtime;
+#define mtime _mtime.__mtime
+ struct {
+ struct in_addr sin_addr;
+ unsigned short sin_port;
+ unsigned short __pad;
+ } contact;

/* Acual statistics for decision making */
int arriba; /* How fast is THIS machine */
AW: [mod_backhand-users] strange problems [ In reply to ]
Thanks very much ... it seems to work now ... statistics are shown
correctly. It isn't balancing yet (testet with siege and 200 concurrent
connections) ... but, i'll play a bit the configurations.

Kind regards,
Andreas de Pretis

> -----Ursprungliche Nachricht-----
> Von: backhand-users-admin@lists.backhand.org
> [mailto:backhand-users-admin@lists.backhand.org]Im Auftrag von Theo
> Schlossnagle
> Gesendet: Freitag, 14. Dezember 2001 08:04
> An: backhand-users@lists.backhand.org
> Betreff: Re: [mod_backhand-users] strange problems
>
>
>
> On Thursday, December 13, 2001, at 07:47 PM, Andreas de Pretis wrote:
> > Server 1 - 172.16.44.3, Netmask 255.255.0.0 - Pentium III (Coppermine)
> > Server 2 - 172.16.44.4, Netmask 255.255.0.0 - Compaq ds20e / Alpha EV67
>
> Can you check ou the CVS version and try that. I have adjusted it so
> that I get the same structure layout on my ev67 and my PIII machines.
> It should work.
>
> Note that this version _WILL NOT_ run in a cluster over 1.2.1 and below
> mod_backhand machines.
>
> Let me know if this works for you...
> The diff, between CVS and the 1.2.1 release is below (if you don't want
> to do a checkout)
>
> --
> Theo Schlossnagle
> 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
>
>
> Index: back_util.c
> ===================================================================
> RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v
> retrieving revision 1.17
> diff -u -r1.17 back_util.c
> --- back_util.c 2001/10/30 19:53:47 1.17
> +++ back_util.c 2001/12/14 07:02:06
> @@ -73,7 +73,7 @@
> return i;
> return -1;
> }
> -int new_session(struct sockaddr_in *sin) {
> +int new_session(unsigned int address, unsigned short port) {
> int nsd;
> struct sockaddr_in sain;
> nsd = socket(AF_INET, SOCK_STREAM, 0);
> @@ -94,7 +94,8 @@
> }
> }
> #endif
> - sain = *sin;
> + sain.sin_addr.s_addr = address;
> + sain.sin_port = port;
> sain.sin_family = AF_INET;
> if(connect(nsd, (struct sockaddr *)&sain, sizeof(struct
> sockaddr_in))<0) {
> if(loglevel & MBLL_NET3) {
> @@ -118,7 +119,9 @@
> }
> for(j=0;j<MAXSESSIONSPERSERVER && rfd<0;j++)
> if(connection_pool[i][j].fd<0) {
> - connection_pool[i][j].fd = new_session(&serverstats[i].contact);
> + connection_pool[i][j].fd =
> + new_session(serverstats[i].contact.sin_addr.s_addr,
> + serverstats[i].contact.sin_port);
> connection_pool[i][j].pid = pid;
> rfd=connection_pool[i][j].fd;
> /* do this because keeping track is REALLY complicated */
> Index: mod_backhand.c
> ===================================================================
> RCS file: /storage/cvs/jesus/mod_backhand/mod_backhand.c,v
> retrieving revision 1.45
> diff -u -r1.45 mod_backhand.c
> --- mod_backhand.c 2001/11/23 22:54:51 1.45
> +++ mod_backhand.c 2001/12/14 07:02:07
> @@ -622,7 +622,8 @@
> goto local_handle;
> }
> if(usepool == MBCP_OFF) {
> - mbcs = new_session(&serverstats[remote_machine.id].contact);
> + mbcs =
> new_session(serverstats[remote_machine.id].contact.sin_addr.s_addr,
> +
> serverstats[remote_machine.id].contact.sin_port);
> } else {
> memcpy(mbcsp_request+1,
> &serverstats[remote_machine.id].contact.sin_addr,
> Index: serverstat.h
> ===================================================================
> RCS file: /storage/cvs/jesus/mod_backhand/serverstat.h,v
> retrieving revision 1.5
> retrieving revision 1.7
> diff -u -r1.5 -r1.7
> --- serverstat.h 2000/04/08 05:12:51 1.5
> +++ serverstat.h 2001/12/14 06:55:55 1.7
> @@ -18,8 +18,16 @@
>
> /* General information concerning the server and this structure */
> char hostname[40]; /* or truncated hostname as the case may be */
> - time_t mtime; /* last modification of this stat structure */
> - struct sockaddr_in contact; /* the associated inet addr + port */
> + union {
> + time_t __mtime; /* last modification of this stat structure */
> + char __pad[8];
> + } _mtime;
> +#define mtime _mtime.__mtime
> + struct {
> + struct in_addr sin_addr;
> + unsigned short sin_port;
> + unsigned short __pad;
> + } contact;
>
> /* Acual statistics for decision making */
> int arriba; /* How fast is THIS machine */
>
>
> _______________________________________________
> backhand-users mailing list
> backhand-users@lists.backhand.org
> http://lists.backhand.org/mailman/listinfo/backhand-users
>
[mod_backhand-users] strange problems [ In reply to ]
On Friday, December 14, 2001, at 02:00 PM, Rob Butler wrote:
> This change probably breaks compatibility with NTBHB correct? The
> backhand broadcast structure is changed and thus will no longer align
> between NT and *nix machines.

Well, NT on alpha will work.... :-)

> What is __mtime defined as on the *nix machines, a 64 bit int?

time_t is 64bits on 64 bit machines.

> Let me know. I'll have to make changes to the NTBHB to keep it inline
> with the new mod_backhand.

All you need to do is ensure that the mtime takes 8 bytes and that the
contact takes eight bytes. The contact is no longer a sockaddr_in as I
didn't see an alignment guarantee on that type. It is now a struct
{ struct in_adrr, unsigned short } padded to 8 bytes.

So on 32 bit machines, you should be able to addopt the serverstat.h
definition pretty directly.

> I won't be able to do that for a little while though.

This won't do in until the next release anyway.

--
Theo Schlossnagle
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
[mod_backhand-users] strange problems [ In reply to ]
Theo,

This change probably breaks compatibility with NTBHB correct? The backhand
broadcast structure is changed and thus will no longer align between NT and
*nix machines.

What is __mtime defined as on the *nix machines, a 64 bit int?

Let me know. I'll have to make changes to the NTBHB to keep it inline with
the new mod_backhand.

I won't be able to do that for a little while though.

Later
Rob
>
>
>On Thursday, December 13, 2001, at 07:47 PM, Andreas de Pretis wrote:
>>Server 1 - 172.16.44.3, Netmask 255.255.0.0 - Pentium III (Coppermine)
>>Server 2 - 172.16.44.4, Netmask 255.255.0.0 - Compaq ds20e / Alpha EV67
>
>Can you check ou the CVS version and try that. I have adjusted it so
>that I get the same structure layout on my ev67 and my PIII machines.
>It should work.
>
>Note that this version _WILL NOT_ run in a cluster over 1.2.1 and below
>mod_backhand machines.
>
>Let me know if this works for you...
>The diff, between CVS and the 1.2.1 release is below (if you don't want
>to do a checkout)
>
>--
>Theo Schlossnagle
>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
>
>
>Index: back_util.c
>===================================================================
>RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v
>retrieving revision 1.17
>diff -u -r1.17 back_util.c
>--- back_util.c 2001/10/30 19:53:47 1.17
>+++ back_util.c 2001/12/14 07:02:06
>@@ -73,7 +73,7 @@
> return i;
> return -1;
> }
>-int new_session(struct sockaddr_in *sin) {
>+int new_session(unsigned int address, unsigned short port) {
> int nsd;
> struct sockaddr_in sain;
> nsd = socket(AF_INET, SOCK_STREAM, 0);
>@@ -94,7 +94,8 @@
> }
> }
> #endif
>- sain = *sin;
>+ sain.sin_addr.s_addr = address;
>+ sain.sin_port = port;
> sain.sin_family = AF_INET;
> if(connect(nsd, (struct sockaddr *)&sain, sizeof(struct
>sockaddr_in))<0) {
> if(loglevel & MBLL_NET3) {
>@@ -118,7 +119,9 @@
> }
> for(j=0;j<MAXSESSIONSPERSERVER && rfd<0;j++)
> if(connection_pool[i][j].fd<0) {
>- connection_pool[i][j].fd = new_session(&serverstats[i].contact);
>+ connection_pool[i][j].fd =
>+ new_session(serverstats[i].contact.sin_addr.s_addr,
>+ serverstats[i].contact.sin_port);
> connection_pool[i][j].pid = pid;
> rfd=connection_pool[i][j].fd;
> /* do this because keeping track is REALLY complicated */
>Index: mod_backhand.c
>===================================================================
>RCS file: /storage/cvs/jesus/mod_backhand/mod_backhand.c,v
>retrieving revision 1.45
>diff -u -r1.45 mod_backhand.c
>--- mod_backhand.c 2001/11/23 22:54:51 1.45
>+++ mod_backhand.c 2001/12/14 07:02:07
>@@ -622,7 +622,8 @@
> goto local_handle;
> }
> if(usepool == MBCP_OFF) {
>- mbcs = new_session(&serverstats[remote_machine.id].contact);
>+ mbcs =
>new_session(serverstats[remote_machine.id].contact.sin_addr.s_addr,
>+
>serverstats[remote_machine.id].contact.sin_port);
> } else {
> memcpy(mbcsp_request+1,
> &serverstats[remote_machine.id].contact.sin_addr,
>Index: serverstat.h
>===================================================================
>RCS file: /storage/cvs/jesus/mod_backhand/serverstat.h,v
>retrieving revision 1.5
>retrieving revision 1.7
>diff -u -r1.5 -r1.7
>--- serverstat.h 2000/04/08 05:12:51 1.5
>+++ serverstat.h 2001/12/14 06:55:55 1.7
>@@ -18,8 +18,16 @@
>
> /* General information concerning the server and this structure */
> char hostname[40]; /* or truncated hostname as the case may be */
>- time_t mtime; /* last modification of this stat structure */
>- struct sockaddr_in contact; /* the associated inet addr + port */
>+ union {
>+ time_t __mtime; /* last modification of this stat structure */
>+ char __pad[8];
>+ } _mtime;
>+#define mtime _mtime.__mtime
>+ struct {
>+ struct in_addr sin_addr;
>+ unsigned short sin_port;
>+ unsigned short __pad;
>+ } contact;
>
> /* Acual statistics for decision making */
> int arriba; /* How fast is THIS machine */
>
>
>_______________________________________________
>backhand-users mailing list
>backhand-users@lists.backhand.org
>http://lists.backhand.org/mailman/listinfo/backhand-users


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com