powered by Jive Software

Openfire Clustering + AWS Load Balancer


We are trying to cluster Openfire and use AWS load balancer to distribute the traffic. We had successfully clustered Openfire with two EC2’s and we are distributing the traffic using AWS load balancer.

We are using Strophe.js on client side and connecting to XMPP using HTTP Bosh, we are hitting into this error “404 invalid sid value” when we try to connect. When there is a single node on the load balancer it works fine, but when we are adding more than one node to the cluster we hit into the error “404 invalid sid value”.

Could you please suggest if using AWS Load balancer for Openfire cluster works or do we need to try some other options for load balancing.


you have to enable sticky sessions for bosh/websocket connection on the load balancer so that the client will always be rooted to the same openfire node.
SO your load balance should only take effect on first connection of this client.

is your issue fixed?

Openfire does not offer support for this. If you choose to use a load balancer in combination with a cluster, then you’ll need to configure your load balancer in such a way that it uses the same host for every request from a particular client (eg: “sticky sessions”). You’ll have to review the support documentation for the load balancer to see if and how that’s supported.

Typically in XMPP setups (like Openfire), the client determines what host (for a particular domain / cluster) to connect to out of band. Mostly, DNS SRV records are used, which allow each client to determine what the best load balancing and fallback strategy is.

@totzkotz @guus Thank you for your suggestion. Can we use HAProxy for load balancing, does it support sticky sessions for BOSH connection.

@mai_tarek No, we are still working on it.

Probably, but I’ve never used it. Please refer to the documentation provided by HAProxy.

Hello Bipin
any news with you about solving that