On Fri, May 12, 2017 at 12:51 AM, Willy Tarreau <[email protected]> wrote: > On Tue, May 09, 2017 at 09:43:22PM -0700, redundantl y wrote: > > For example, I have tried with the latest versions of Firefox, Safari, > and > > Chrome. With 30 elements on the page being loaded from the server > they're > > all being loaded within 70ms of each other, the first 5 or so happening > on > > the same millisecond. I'm seeing similar behaviour, being sent to > > alternating backend servers until it "settles" and sticks to just one. > > That's only true after the browser starts to retrieve the main page which > gives it the indication that it needs to request such objects. You *always* > have a first request before all other ones. The browser cannot guess it > will have to retrieve many objects out of nowhere. > > As I've said before, the issue here is these objects aren't hosted on the same server that they're being called from.
"A separately hosted application will generate HTML with several (20-30) elements that will be loaded simultaneously by the end user's browser." So a user might go to www.example.com and that page will load the objects from assets.example.com, which is a wholly separate server. > The principle of stickiness is to ensure that subsequent requests will go > to the same server that served the previous ones. The main goal is to > ensure that all requests carrying a session cookie will end up on the > server which holds this session. > > Here as Lukas explained, you're simulating a browser sending many totally > independant requests in parallel. There's no reason (nor any way) that > any equipment in the chain would guess they are related since they could > arrive in any order, and even end up on multiple nodes. > > Well, all of these requests will have the url_param email=, so the load balancer has the ability to know they are related. The issue here, at least how it appears to me, is since they come in so fast the stick-table entry doesn't get generated quickly enough and the requests get distributed to multiple backend servers and eventually stick to just one. > If despite this that's what you need (for a very obscure reason), then > you'd rather use hashing for this. It will ensure that the same > distribution > algorithm is applied to all these requests regardless of their ordering. > But > let me tell you that it still makes me feel like you're trying to address > the wrong problem. > > Since changing to load balancing on the url_param our issue has been resolved. > Also, most people prefer not to apply stickiness for static objects so that > they can be retrieved in parallel from all static servers instead of all > hammering the same server. It might possibly not be your case based on your > explanation, but this is what people usually do for a better user > experience. > > The objects aren't static. When they're loaded the application makes some calls to external services (3rd party application, database server) to produce the desired objects and links. > In conclusion, your expected use case still seem quite obscure to me :-/ > > Willy > I agree, our use case is fairly unique.

