[英]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. 我们使用ASP.Net Application变量将应用程序状态设置为“联机/脱机”,或者使应用程序中的某些重要消息处于“在线/离线”状态,因此,当我尝试更新一个应用程序变量时,它在一台服务器上可用,而在另一台服务器上不可用。 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. 一个选择:您可以让每个Web服务器存储(并管理,刷新,失效)其自己的应用程序缓存。 But then you run the chance of storing different copies. 但是随后您就有机会存储不同的副本。
Another option: distributed cache such as memcached or ncache or something else. 另一个选择:分布式缓存,例如memcached或ncache或其他东西。
Another option: read/write the data out to a shared disk. 另一个选择:将数据读/写到共享磁盘。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.