Load Balancing, AJAX, and You

拜拜、爱过 提交于 2019-12-06 10:05:28

I'd configure my load balancer with stickey sessions to avoid this problem.

With sticky sessions, you'll be directed to the same server over and over again during the session.

If your application is stateless, it shouldn't matter. Whether a standard HTTP request or Ajax based request to your server, if your application does not rely on server side state (such as a session), then it shouldn't matter if you hit different servers on subsequent requests.

Edit - given the question update mentioning you use in memory session state, then your approach to solving the issue for standard page requests will implicitly solve for Ajax. You have essentially two ways to go - sticky sessions through the load balancer so the same user gets the same server, or sharing the session state between your servers through a caching/storage mechanism.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!