Azure-静态库需要重装 [英] Azure- static repository needs reloading

查看:124
本文介绍了Azure-静态库需要重装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有存储有静态库中存储大量的XML文件的结构和在MVC应用程序被加载一次。应用程序是用两个实例托管在Azure上(PAAS)。
我们有一个设计工具,可用于添加更多的东西或从该库中删除的东西。我们发现目前的挑战是,一旦东西被添加我们需要拆除存储库并重新创建它来重新载入资源库。这工作,但离开该静态库已更新只在服务器A上,而不是在服务器B上的一个问题
如果一个请求到达服务器B时,用户犯规看到这种变化,因为它没有被更新。
上; Y在这两种情况下的IIS重置解决了这个问题。我一直在使用会话状态来存储库尝试,但像我们作为存储在数据库表中的session_start事件被称为在每个页面请求引起性能问题的值自定义的会话提供使用。
有没有人在那里有一个更优雅的解决方案,以更新两台服务器上的存储库,并使用任何现代技术。

I have a static repository with stores a large XML file structure in memory and is loaded only once in the MVC application. The application is hosted on Azure (Paas) with 2 instances. We have a design tool which is used to add more stuff or remove stuff from this repository. The challenge we find is that once stuff gets added we need to reload the repository by tearing down the repository and re-creating it. This works but leaves a problem that the static repository has been refreshed only on server A and not on server B. If a request goes to server B, the user doesnt see that change as it has not been updated. On;y an IIS reset on both instances fixes the problem. I have tried using Session state to store the repository but as we use as custom Session provider which stores the values in a database table the session_start event is called on every page request causing performance problems. Does anyone out there have a more elegant solution to updating the repository on both servers and using any modern techniques.

推荐答案

你有没有用在角色高速缓存来存储库考虑(当然,坚持它,以及你正在做的话)?

Have you considered using an in-role cache to store the repository (of course, persist it as well as you are doing already)?

您可以使用内存从现有的Web角色,或者创建一个专用的高速缓存的作用。高速缓存将跨越所有实例,所以你会从每个实例访问相同的数据。

You can either use memory from your existing web role, or create a dedicated cache role. The cache will span all of your instances, so you'd be accessing the same data from each instance.

把它一步:如果您在角色实例重新启动期间很担心数据丢失(这将意味着你的一些数据将不再是在缓存中,当实例关闭),您可以启用高可用性缓存命名空间。在这一点上,数据实例之间复制,它可以让你生存的实例重新启动。

Taking it one step further: If you're concerned about data loss during a role instance reboot (which would mean some of your data would no longer be in the cache when the instance goes down), you can enable High Availability on the cache namespace. At this point, data is replicated between instances, which lets you survive an instance restart.

您会发现在角色属性的同一地点(或专用)缓存设置:

You'll find the co-located (or dedicated) cache setting in the role properties:

这篇关于Azure-静态库需要重装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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