LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > when max connections reached redirect

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2009, 01:22 PM
kc8yds kc8yds is offline
Member
 
Join Date: Apr 2008
Posts: 35
Default when max connections reached redirect

say i have 3 servers
1.media.com 2.media.com 3.media.com

i have max connections on each of them set to 75


once max connections is reached on 1.media how can i do a header redirect to 2.media.com ?
Reply With Quote
  #2  
Old 08-13-2009, 01:43 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
It wont work that way. once the max connections reached, no more TCP connections will be accepted by LSWS, so it wont be able to send back a redirect response.

You have to use something like DNS load balancing, or use our Load balancer in front of the web server farm.
Reply With Quote
  #3  
Old 08-13-2009, 01:46 PM
kc8yds kc8yds is offline
Member
 
Join Date: Apr 2008
Posts: 35
:-/

guess i'll go with dns round robin then



just wish something like this was possible to make sure all servers are used to their max (round robin can easily send more traffic to one server than another)
Reply With Quote
  #4  
Old 08-14-2009, 08:09 AM
robfrew robfrew is offline
Senior Member
 
Join Date: Dec 2007
Location: Salt Lake City UT
Posts: 151
Quote:
Originally Posted by kc8yds View Post
:-/

guess i'll go with dns round robin then



just wish something like this was possible to make sure all servers are used to their max (round robin can easily send more traffic to one server than another)
That's why load balancers are nice!
Reply With Quote
  #5  
Old 08-14-2009, 01:42 PM
kc8yds kc8yds is offline
Member
 
Join Date: Apr 2008
Posts: 35
<?
header('Content-Type: text/plain');
preg_match('/'.preg_quote('o]: REQ_PROCESSING: ').'([0-9]{1,3})/',file_get_contents('/tmp/lshttpd/.rtreport'),$matches);
header('Content-Length: '.strlen($matches[1]));
echo $matches[1];


^ rtreport.php on video.1-5.site.com

then site.com checks each starting at 1 with a timeout of 100 ms (will test going even lower--all servers are located on the same network) -- if it times out or if the number returned equals 90% or more it tries the next



isn't the nicest looking solution but it works and that is all that matters
Reply With Quote
Reply

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


All times are GMT -7. The time now is 02:51 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.