Recently, quite a few people have mailed me asking how I perform session persistence correctly across the different webservers I run. It’s a good question, and one which i’m pleased to answer. My webservers host many different resources, not just a blog. Not all these services are hosted on both boxes. So, here’s how I quickly spread the different services.
$path = http.getpath();
#log.info( "Path: ".$path );
$host = http.getHostHeader();
# Send these client requests to a pool of nodes that uses cookies
# for Session Persistence
if( string.contains( $path, "gallery" ) ||
string.contains( $path, "postfixadmin" ) )
{ pool.use( "Sticky Pool" );
# All other clients, if they need re-directing to a specific node,
# we do it here.
} else if( string.contains( $path, "ids" ) ||
string.contains( $path, "awstat" ) ||
string.contains( $path, "mailscanner" )||
string.contains( $host, "rt" ) ||
string.contains( $host, "webmail" ) ||
string.endswith( $path, "cgi" ) ||
string.contains( $path, "~" ) )
{ connection.setPersistenceNode ( "192.168.4.3:8081" );
}
Yes, it really is -that- simple.
April 23, 2007



















Sorry, no comments yet.