Length of load balancing variable?

Hello all.

I have a strange one that I’m not certain if it’s an haproxy issue or a Collabora Office Online issue. Naturally when working with Collabora support they want it to be an haproxy issue :slight_smile:

The backend element looks like:
mode http
timeout tunnel 3600s
balance url_param WOPISrc check_post
hash-type consistent
server edit1
server edit2

For most of the system all works as intended but when dealing with cutting and pasting in a template (basically in a quite obscure area of the program) suddenly CTRL-C and CTRL-V stop working. If one works back to a new open document it all works again.

Initially I thought there was no way that this is an HAProxy problem, and I said so volubly! But I then tried a test…

I commented out one of the servers in the back end. And it all works.
I then changed backend servers, it still works!

As soon as the load balance element has more than one server listed, it fails.

So the only possible issue that I have come up with is that there a size limitation on the variable url_param - in this case WOPISrc. This can be nearly 600 characters (certainly over 512) could this be a cause?

Thanks to all as always,


Even if the url_param would be truncated, it should not lead to erroneous load balancing, it would just not consider the entire string.

If the string is abcdefgh but haproxy only looks at abc, abcdefgh will always lead to abc and therefor it would lead to the same load balancing decision.

If would recommend against using url_param, unless Collabora has specifically told you that the WOPISrc get parameter is what you need to look at for a load-balancing decision in front of multiple bcakend servers.

This would require that the WOPISrc get parameter is present in every single request in the entire application, it is never offloaded to cookie or session storage.

I just don’t believe that this is actually the case. If you want to go down that rabbit hole, turn on HTTP logging of verify every single HTTP transaction, and check whether haproxy routes the request to the correct backend server or not.

But by relying on a GET parameter of the application you are making your setup fragile.

I’d suggest alternatives:

  • balance source just load-balance based on the source IP without any HTTP or cookies requirements
  • or use cookies stickiness instead, by using a dedicated haproxy cookies for load-balancing decisions

config example:

backend test
 mode http
 balance roundrobin
 cookie HAPLB insert indirect nocache
 server edit1 cookie edit1
 server edit2 cookie edit2

Thanks Lukas,

The problem behind and the reason for the use of url_param is that we can end up with multiple people co-editing a single document and therefore they HAVE to go to the same page and that requires the use of WOPISrc. I don’t like it, but it is necessary.

I get your point that the url being truncated would always still point to the one location.

My problem remains though, if no second server available it works. as soon as there is a second server we see the failure. Why? What are the other alternatives that could be at play here?

Just to be 100% clear, if you type in a document template it works, it’s just the CTRL-C and CTRL-V that fail.



Like I said: