asp.netapplication-state

Application variable across load balanced servers (ASP.Net)


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.


Solution

  • 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.