在负载均衡的服务器应用程序变量(ASP.Net) [英] Application variable across load balanced servers (ASP.Net)

查看:223
本文介绍了在负载均衡的服务器应用程序变量(ASP.Net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有两个负载均衡的服务器上运行一个网站。我们使用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.

推荐答案

您使用粘性会话?多久的数据改变?是应用程序缓存甚至是必要的?

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.

另一种选择:分布式缓存如memcached的或NCACHE或别的东西。

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

另一种选择:读/写数据到共享磁盘

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

这篇关于在负载均衡的服务器应用程序变量(ASP.Net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆