when max connections reached redirect

kc8yds

Active Member
#1
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 ?
 

mistwang

LiteSpeed Staff
#2
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.
 

kc8yds

Active Member
#3
:-/

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)
 

kc8yds

Active Member
#5
<?
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
 
Top