Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 15th June 2007, 13:14
jorge.gonzalez jorge.gonzalez is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Loadbalanced apache web server with sticky sessions

Hi all!

This is about Howto http://www.howtoforge.com/load_balan...proxy_balancer

It is supossed that, in byrequest mode, each request to main apache is switching between the two backend web servers and the session were still alive, isn't it? Then, why I have always been forwarded to the same backend apache? I mean, I tried with firefox, loged in wordpress testing app and, if I refresh page, then I'm again in the same backend web server. If I delete the cookie BALANCEDID then (maybe) the main apache forward me to the second backend server. What if backend apache is down? Does do failover?

If I try with konqueror (or other PC) then I am able to access to the other backend web server.

Then, the question is: Is the user always using the same backend web server and only the main apache switch between servers when there are different users?

Sorry for my bad english ;-)

thanks in advance
Reply With Quote
Sponsored Links
  #2  
Old 15th June 2007, 14:24
jorge.gonzalez jorge.gonzalez is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default working 50% ok

Well, I dont know why but reloading main apache web server it's working. But I see that if I stop one backend web server then all request go to the webserver which is up (failover ok)

Then if I start the stopped web server, request are not going to this server any more unless main apache web server was reloaded
Reply With Quote
  #3  
Old 15th June 2007, 15:11
jorge.gonzalez jorge.gonzalez is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Answering myself

As Apache mod_proxy says:

retry 60 Connection pool worker retry timeout in seconds. If the connection pool worker to the backend server is in the error state, Apache will not forward any requests to that server until the timeout expires. This enables to shut down the backend server for maintenance, and bring it back online later.

Then 1 minute without balancing (two servers), after 1 min everything works ok :-)
Reply With Quote
  #4  
Old 16th June 2007, 14:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Quote:
Originally Posted by jorge.gonzalez
It is supossed that, in byrequest mode, each request to main apache is switching between the two backend web servers and the session were still alive, isn't it?
No, if the requests were switching between the backend servers, then you'd lose the session. Therefore requests from one client always go to the same backend server (unless you delete the cookie on the client PC or use another browser on the client PC).

Quote:
Originally Posted by jorge.gonzalez
Then, the question is: Is the user always using the same backend web server
Yes.

Quote:
Originally Posted by jorge.gonzalez
and only the main apache switch between servers when there are different users?
Yes.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 18th June 2007, 12:12
jorge.gonzalez jorge.gonzalez is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Then, I don't understand

Falko, I can't realize what is going on. As I said I have 2 wordpress (wp1 & wp2) running on backend servers and one server acting as primary (wp), balancing requests.

As you know wordpress has a login procedure with session and cookie. My primary server is balancing between backend servers and is keeping the session!!

Now my browser is logged on wp1. If page is reloaded then I will be in wp2 and also logged. It's easy to see the alive session because I can access to site admin (link) whatever I were wp1 or wp2. If I log out then in both WP's there's no site admin link but login link

Still more. Let's try
I'm going to stop wp2 (now I'm on it) server while I'm logged: Ok, wp jumps to wp1 with the session alive because wp2 is down. 1 minute and wp2 will be up, then wp should to jump to wp2 and the session should be there.... Ok, wp2 is up and I wp is switching between wp1 & wp2 with the session.

Let's try with wp1. Session logged. wp1 down, working with wp2. 1 minute later wp1 is up and wp is switching between 2 backend servers with the session still alive.

How do you explain that?
Reply With Quote
  #6  
Old 19th June 2007, 14:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Does WordPress store the sessions in the MySQL database? If so, and both WP installations use the same database, then you don't lose the session, even if you're switching between the backend servers.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 19th June 2007, 16:25
jorge.gonzalez jorge.gonzalez is offline
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default That is

Yes, WPs are working with the same DB and stores sessions in DB.
Thanks Falko
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LAMPS: Is it ok to run SMB on a Web Server? lightnb Server Operation 11 25th June 2007 23:57
Rejecting outbound mail tristanlee85 General 11 20th May 2007 18:04
550-The recipient cannot be verified email problem safoo Installation/Configuration 7 29th November 2006 20:55
Apache Web Forwaring mattbrown Server Operation 1 17th May 2006 16:42
Problem with the installation of Dokeos (LMS) in ISPConfig jofranco General 4 28th April 2006 01:45


All times are GMT +2. The time now is 18:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.