Browsing sessions are switching between data center nodes in load balanced environment
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When browsing a site hosted on a Data Center platform, the client is switching sessions from one node to the other in between each page load.
This can often be confirmed by observing the "NodeID" that is printed at the bottom of almost every Confluence page - if that NodeID is changing in between page navigations or page refreshes then the load balancer is not persisting sessions and the client is "bouncing" between nodes.
Environment
Load-balanced Confluence Data Center
- this is to include the load balancer / Ingress of:
- A Kubernetes cluster if Confluence DC is running in a K8 cluster
- NetScaler
Cause
Session Affinity, or "Sticky Sessions", is not enabled on the load balancer.
Solution
The steps for implementing this feature differs from load balancer vendor to vendor, look for "Session Affinity" or "Sticky Sessions" and ensure this is enabled. This is a requirement for Confluence per "Load Balancer Configuration Options" to use session persistence when load balancing.
Kubernetes Ingress Annotation example
In the case where, when deploying Confluence via a Helm chart to a Kubernetes cluster, you happen to not be using the default NGINX Ingress/Ingress Controller and are using Traefik instead, the following would be the annotations necessary to ensure the Traefik Ingress (acting as the load balancer) enforces session persistence.
traefik.ingress.kubernetes.io/service.sticky.cookie: "true",
traefik.ingress.kubernetes.io/service.sticky.cookie.name: "confluence_cookie",
traefik.ingress.kubernetes.io/service.sticky.cookie.secure: "true"
NetScaler Example
If you're using NetScaler session affinity can be done via COOKIEINSERT.
Session Affinity Method: COOKIEINSERT
Time-out (mins): 0 (no expiry)
Cookie Name: <empty>