开发者

Application variable across load balanced servers (ASP.Net)

开发者 https://www.devze.com 2023-04-05 16:08 出处:网络
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开发者_运维知

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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号