Intelligent Request Routing

View: New views
2 Messages — Rating Filter:   Alert me  

Intelligent Request Routing

by roncking-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



The nature of my application is that users logging in to the application
are highly related to one another in groups. For example if there are
100 users logged in, then they would roughly fall into 10 groups of 10
users. I would like to make sure that all the users servlet sessions in a given group are
all routed to the same server by using a java based load balancer and WADI.

The reason for this is that each users
requests within a group use the distinct set of resources on a given server,
so I would like to keep each server to just load the resources (objects
from the database, etc) necessary for the users that are associated with
that group, and all on the same server.

I envision needing code to allow one servlet container to migrate a
session to another container, and also communicate with the load
balancer to tell it to send all new requests to the new server.

In more practical terms... Imagine I'm running a poker game site that
runs many poker games on many servers. Each game (a "group") has 10 players. I want to be able
to move a player from one game to another by moving their session, and
telling the load balancer where they moved to.

There are two features mentioned in the features.txt document
that look applicable, but I don't know how to use them:

- Transparent on-demand session migration between nodes
- Transparent on-demand request proxying[/redirection] between nodes

Would WADI be suitable for doing the session migration? If so,
where should I start looking in the code to do this?

Thank you for your help.

Ron

Re: Intelligent Request Routing

by Gianny Damour-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ron,

Based on your description, I would say that you actually do not need  
to directly integrate with WADI.

According to me the key is a smart and independent load-balancer. Out-
of-the-box, WADI transparently migrates session from node to node  
when necessary.

Let's assume that you have a session on node A and that you want to  
move this session to node B. To move the session, the only thing that  
you need to do is to instruct the load-balancer to route the next  
HTTP request bound to this session to node B. When the request is  
received by node B, WADI will migrate the session from node A to node B.

So, I will implement a kind of HTTP proxy, which uses a mapping table  
between player and server to route HTTP requests. When you want to  
move a player to another server, you update the routing table  
accordingly. The next time that an HTTP request bound to this player  
is received, it will be routed to the server defined in the routing  
table and WADI will migrate the session.

Thanks,
Gianny


On 01/11/2009, at 6:08 AM, Ron King wrote:

>
>
> The nature of my application is that users logging in to the  
> application
> are highly related to one another in groups. For example if there are
> 100 users logged in, then they would roughly fall into 10 groups of 10
> users. I would like to make sure that all the users servlet  
> sessions in a given group are
> all routed to the same server by using a java based load balancer  
> and WADI.
>
> The reason for this is that each users
> requests within a group use the distinct set of resources on a  
> given server,
> so I would like to keep each server to just load the resources  
> (objects
> from the database, etc) necessary for the users that are associated  
> with
> that group, and all on the same server.
>
> I envision needing code to allow one servlet container to migrate a
> session to another container, and also communicate with the load
> balancer to tell it to send all new requests to the new server.
>
> In more practical terms... Imagine I'm running a poker game site that
> runs many poker games on many servers. Each game (a "group") has 10  
> players. I want to be able
> to move a player from one game to another by moving their session, and
> telling the load balancer where they moved to.
>
> There are two features mentioned in the features.txt document
> that look applicable, but I don't know how to use them:
>
> - Transparent on-demand session migration between nodes
> - Transparent on-demand request proxying[/redirection] between nodes
>
> Would WADI be suitable for doing the session migration? If so,
> where should I start looking in the code to do this?
>
> Thank you for your help.
>
> Ron


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email