+

Search Tips   |   Advanced Search

Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS

 

HTTP session rebalancing


You can dynamically and actively balance the distribution of HTTP sessions among application servers by using HTTP session rebalancing.

WebSphere® Application Server assigns HTTP sessions based on application server affinity. After a session is established in a particular application server, subsequent requests that belong to the same session are assigned to the application server that has the established session affinity.

Session affinities cause the session load to balance out for a cluster in the long term, and generally any imbalances that occur are short-lived and tolerable. However, you can use session rebalancing to help some of the shorter term imbalances that can occur, without modifying the performance benefits of session affinities.

WebSphere Virtual Enterprise uses session rebalancing to expedite the balancing of sessions across a cluster. You can use session rebalancing if you use distributed sessions and track your sessions with cookies. By default, WebSphere Virtual Enterprise application servers are configured with Session tracking enabled using cookies, but without distributed sessions.

The steps that you use for configuring servers in static clusters can also be used for servers in dynamic clusters. If you are configuring dynamic clusters, leave the dynamic cluster in manual mode initially so that the servers in the cluster are not started automatically. After the distributed environment settings of all the servers in the cluster are changed, switch the dynamic cluster to automatic mode. If you do not switch modes, stop and restart the servers that are already started in the dynamic cluster to pick up the distributed environment setting changes.

When a new server becomes available in a dynamic cluster, that server does not have any assigned HTTP sessions. However, the existing servers in the dynamic cluster have sessions with assigned affinity.

 

V6.0.1 and later session rebalancer

Mixed-version environment: If you are using a mixed environment that includes both V6.0 (all releases) and V6.1 nodes, the session rebalancer continues to run the way that it did before you installed Version 6.1.mixv

With WebSphere Extended Deployment Version 6.0.1 and later, the goal of session rebalancing is to reassign sessions so that the number of sessions that are running in each server in the dynamic cluster is proportional to the assigned weight of the servers. The dynamic workload manager (DWLM) performs the session rebalancing function. DWLM decides how many sessions to move and where to move the sessions based on the knowledge about the entire dynamic cluster. The DWLM component factors in the session location and can initiate session moves in addition to changing the weight on specific servers. Any events that DWLM monitors can initiate the moves, such as new servers starting, overloaded servers, and so on.

DWLM often picks a very uneven distribution of routing weights. This approach is allowed because the only objective DWLM has is equalizing service times. With WebSphere Extended Deployment V6.0.1 and later, a secondary goal is added to DWLM. DWLM attempts to even out the routing weights when possible without significant degradation of the primary objective of equalizing service times.

If you are using ObjectGrid-based HTTP session support instead of the normal WebSphere Application Server session management, HTTP session rebalancing is not supported.

If you are using sessions that are maintained by Uniform Resource Locator (URL) rewriting or SSL IDs, no rebalancing is performed. Rebalancing is also not performed on HTTP POST requests. Sessions are not rebalanced if the session is accessed by issuing the HTTP request directly to the application server HTTP port, bypassing the on demand router. The PMI counter for memory sessions reflects the moving sessions. Specifically, the PMI counter decreases on existing servers as sessions move and increases on the new servers that are recently started. However, new sessions are load balanced across any of the servers in the cluster. See the WebSphere Application Server Network Deployment Information Center for more information about analyzing PMI data and best practices for using HTTP sessions.

 

V6.1 session rebalancer

In WebSphere Virtual Enterprise V6.1 and later, the session rebalancer request and response filters are in the ODR. These filters keep track of which sessions are being sent to which servers, to get a live session count. Using information from the dynamic workload manager (DWLM) for each dynamic cluster, the ODR also tracks the number of sessions that are being sent to each server, ranking the servers in the dynamic cluster. This ranking is used to determine how many sessions to move between servers. The default configurations vary depending on the type of dynamic cluster that you are using:

HTTP session balancing is supported when you are using ObjectGrid-based HTTP session support instead of the normal WebSphere Application Server session management.

 

Session rebalancer configuration

You can enable or disable session rebalancing by adjusting the HttpSessionRebalanceOff custom property on the dynamic cluster in the administrative console.

To enable session rebalancing on the other middleware server types and ObjectGrid servers, set the HttpSessionRebalanceOff custom property to false for the dynamic cluster. Session rebalancing is automatically enabled for dynamic clusters that have application servers. Set the custom property on the specific dynamic cluster.

 

Example

The following example illustrates session rebalancing in a WebSphere Virtual Enterprise V6.1 environment. In this example, both V6.0.1and V6.1 dynamic clusters exist in the configuration. The V6.0.1 servers continue to perform session rebalancing within the server. The V6.1 server performs session rebalancing by sending information from DWLM to the ODR. The ODR then routes the HTTP sessions to the appropriate server.

Figure 1. HTTP session rebalancing in WebSphere Virtual Enterprise V6.1
V6.1 rebalancing scenario



 

Related concepts


Dynamic clusters

 

Related tasks


Creating dynamic clusters
Configure for database session persistence
Configure memory-to-memory replication for the peer-to-peer mode (default memory-to-memory replication)

 

Related reference

Related information


Application placement custom properties