WebSphere Tutorial · Traditional WebSphere Application Server · Lesson 15 of 23

Clusters, IBM HTTP Server and the Plug-in

How requests reach cluster members through IBM HTTP Server and the WebSphere plug-in, with session affinity and failover.

Members can save this page, take notes and track progress. See membership · Sign in

The request path

Browser → load balancer → IBM HTTP Server + WebSphere plug-in → cluster member (orders1 or orders2)

The plug-in reads plugin-cfg.xml, which lists each cluster's members, their ports and the URIs each application serves. For a new session it picks a member (round robin or random, with weights); afterwards it uses the clone ID at the end of the JSESSIONID cookie to keep the user on the same member (session affinity). If a member stops responding within its timeouts, the plug-in marks it down and tries another.

Keeping the plug-in current

Regenerate and propagate plugin-cfg.xml whenever applications, virtual hosts or cluster members change; stale files send requests to members that no longer exist or miss new URIs. Settings such as ConnectTimeout and ServerIOTimeout decide how quickly a failing member is bypassed.

Session affinity by clone ID, and what happens when a member failsTry it yourself
import itertools

members = {"orders1": {"clone": "1a2b3c", "up": True}, "orders2": {"clone": "4d5e6f", "up": True}}
rr = itertools.cycle(members)

def route(cookie=None):
    if cookie:
        clone = cookie.split(":")[-1]
        for name, m in members.items():
            if m["clone"] == clone and m["up"]:
                return name, cookie
    name = next(n for n in rr if members[n]["up"])
    return name, f"0000SESSION:{members[name]['clone']}"

first, cookie = route()
print("new session ->", first, "cookie", cookie)
print("next request ->", route(cookie)[0])
members[first]["up"] = False
print(f"{first} fails  ->", route(cookie)[0], "(session lost unless replicated)")

Output

new session -> orders1 cookie 0000SESSION:1a2b3c
next request -> orders1
orders1 fails  -> orders2 (session lost unless replicated)

Test yourself

How does the plug-in keep a user on the same cluster member?

  1. By the user's IP address
  2. With the clone ID in the JSESSIONID cookie
  3. By DNS
  4. It doesn't
Show answer

Answer: With the clone ID in the JSESSIONID cookie

Session affinity uses the clone ID appended to the session ID.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake