Greetings,

I have a couple of servers I've been working on.  They run apache2 and
mod_perl, mostly doing Apache::ASP work.  They work together to handle
the load, using a cisco localdirector.

We recently noted that one of the servers is handling about 500
threads, and the other 300.  We modified the loaddirector to remove
the sticky flag on http port, and it immediately balanced 400/400. 
But thats not what this email is about.  this email is about what
happened to the cookies.

Essentially, the site sells subscriptions to content.  Because there
is more than one system, instead of using sessions (as was implimented
when it was on windows, I translated it) I am using cookies.  When a
user links into various galleries and gateways to enter the site, the
system sets cookies.

First, an apparent bug in the Response cookie method.

I originally simply used the $Response->Cookies(...) calls to do this,
but that wasn't working.  Upon inspecting the code and doing some
debugging, I determined that the logic was just... wrong.  There may
be code I couldn't find, but the Response->Cookies function did not
appear to be setting up the structure that is required when generating
the cookies - that is, all the values inside of a {Value} hash
reference, with Domain and Expires as members of the same hash...
essentially

$Response->Cookies('ccc', 'key', 'val') ;
$Response->Cookies('ccc', 'Domain', 'mydomain.com');

resulted in

$Response->{Cookies}{ccc}{key} = 'val';
$Response->{Cookies}{ccc}{Domain} = 'mydomain.com';

when it should have resulted in

$Response->{Cookies}{ccc}{Value}{key} = 'val';
$Response->{Cookies}{ccc}{Domain} = 'mydomain.com';

Did I miss a fix thats already been submitted?  Is a fix needed to be
submitted to correct this problem?  Am I using the method incorrectly?

I worked around it by populating the Response->{Cookies} hash manually for now.

Now the REAL perplexing problem.

As I mentioned we have two servers, which were running sticky.  The
clients arrive, get their cookies, return the cookies when signing up,
and everybody is happy because they get their commissions.  BUT, the
servers were not running balanced (and the more loaded one was running
into swap and slowing down response time) so we turned off session
sticky on port 80.

Despite personal tests that worked fine - cookies set when they were
supposed to be, returned, page logic showed everything was working -
things weren't.  Joe Random User was somehow unable to get and/or
return the cookie values!  Signup rate plunged, and what signups we
did get were without documentation as to from whence they came.

We turned sticky back on, and immediately signup rates turned to
normal, and were documented.

I've been puzzling over this for about two days now - usually I come
up with something after awhile, realizing some method I used was not
correct in all circumstances or something - but this one really
boggles me.  Now that I've bounced it off of some other experts - What
do you think?  Any questions about the setup, methods, or any of that?
 Am I missing something that would be impacted by the user hopping
randomly between the servers?

Thanks for your time in reading this rather long detailed message, and
in advance for your thoughts.

Skylos

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to