NHibernate Azure AppFabric 缓存
有人尝试过使用 NHibernate Velocity L2 缓存提供程序来对抗 Azure AppFabric 缓存吗?如果是这样,你发现了什么?
附带说明一下,我们使用 SQL Azure 来存储数据。
Has anyone tried using the NHibernate Velocity L2 cache provider against the Azure AppFabric Cache? If so, what did you discover?
On a side note, we're using SQL Azure to store our data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最新版本的“Windows Azure 缓存(预览版)”应该可以帮助您 - http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/9a2dbd9f-1b9d-4249-a48b-216d9dfdc2bc
您支持通知、改进的延迟、更大的灵活性和定价仅基于您配置的虚拟机的计算成本。
The latest release "Windows Azure Caching (Preview)" should help you - http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/9a2dbd9f-1b9d-4249-a48b-216d9dfdc2bc
You have support for Notifications, improved latencies, greater flexibility and pricing only based on Compute cost of the VMs you configure with.
我们的缓存用例如下:
不幸的是,Azure AppFabric 缓存的当前状态不适合我们的需求。原因如下:
调整 NHibernate Velocity 提供程序后,我们能够在分布式缓存中缓存对象,但访问每个实体时有一个小延迟(约 1 秒)。因为我们尝试每个 Web 请求访问数百个缓存对象,所以每个 HTTP 请求实际上比我们直接访问数据库要慢 - 当然不是我们想要的。
我们尝试通过启用 AppFabric 本地缓存来解决此问题。性能得到了极大的提高,但这又带来了另一个问题。一旦对象被存储到本地缓存中,它将一直保留在那里直到过期(您可以为缓存设置过期时间)。此时,AppFabric 本地缓存和 NHibernate SysCache 提供程序(使用 ASP.NET 缓存)之间没有太大区别,只是您必须为 AppFabric 缓存支付额外费用。
如果 Azure AppFabric 本地缓存支持通知(例如其 Windows Server AppFabric 同类),我们很乐意使用 Azure 缓存。请在 www.mygreatwindowsazureidea.com 上为该功能投票。
作为参考,同事 在 Azure 论坛上发布了一个有关 AppFabric 本地缓存使用的问题。
如果有人发现 MS 在 Azure 上启用了本地缓存通知,请发布我原来问题的答案。
Our use case for caching is listed as follows:
Unfortunately, the current state of the Azure AppFabric Cache doesn't suit our needs. Here's why:
After tweaking the NHibernate Velocity provider, we were able to cache objects in the distributed cache, but there was a small delay (~1second) when accessing each entity. Because we were trying to access hundreds of cached objects per web request, each HTTP request was actually slower than if we accessed the DB directly - certainly not what we were looking for.
We tried to fix this issue by enabling the AppFabric local cache. The performance was drastically improved, but this raised another problem. Once an object is stored in the local cache, it will stay there until it expires (you can set an expiration timespan for the cache). At this point, there isn't much difference between the AppFabric local cache and the NHibernate SysCache provider (which makes use of the ASP.NET Cache), except that you have to pay extra for the AppFabric cache.
If the Azure AppFabric local cache supported notifications like its Windows Server AppFabric cousin, we'd be happily using the Azure cache. Please vote for this feature at www.mygreatwindowsazureidea.com.
For reference, a co-worker posted a question on the Azure forums concerning the use of the AppFabric local cache.
If anyone discovers that MS has enabled local cache notifications on Azure, please post an answer to my original question.