Application variable across load balanced servers (ASP.Net)

吃可爱长大的小学妹 提交于 2020-01-05 12:24:06

问题


We have a website that runs on two load balanced servers. We used the ASP.Net Application variable to make application state "online/ offline", or for some important messages across the application, So when i try update a application variable its available on one server but not on other. How i can manage a application variable across load balanced servers. What may I use? Of course keeping it as simple as possible.


回答1:


Are you using sticky sessions? How often does the data change? Is application cache even necessary?

One option: You can have each webserver store (and manage, refresh, invalidate) its own application cache. But then you run the chance of storing different copies.

Another option: distributed cache such as memcached or ncache or something else.

Another option: read/write the data out to a shared disk.




回答2:


Store that information in a database that all servers have access to and access information from.



来源:https://stackoverflow.com/questions/7449709/application-variable-across-load-balanced-servers-asp-net

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