Azure - Alternative method to slow Windows Azure Caching for multi instances

流过昼夜 提交于 2019-12-13 04:46:16

问题


We current move our existing web application to Azure. Azure Caching is very slow.

Is there any alternative caching mechanism (better than Azure Caching) for multi instances in Azure? For example, storing caching in Azure Storage or Azure SQL.

Thank you for your input!

Added

public class AzureCacheService : ICacheService
{
    readonly DataCacheFactory _factory = new DataCacheFactory();

    private readonly DataCache _cache;

    public AzureCacheService()
    {
        _cache = _factory.GetDefaultCache();
    }

    public object Get(string key)
    {
        return _cache.Get(key);
    }

    public void Insert(string key, object obj)
    {
        if (obj != null)
        {
            _cache.Put(key, obj, new TimeSpan(3, 0, 0));
        }
    }

    public void Remove(string key)
    {
        _cache.Remove(key);
    }
}

*** Accessing *** 
IoC.Resolve<ICacheService>().Insert(key, MyObject);

IoC.Resolve<ICacheService>().Remove(key);

回答1:


In general, WA Caching is not slow, particularly if you turn on "local caching" (which should generally turn the latency down to around 0ms, as long as the data fits in memory). Memcached is another possibility: http://blog.smarx.com/posts/memcached-in-windows-azure.

You won't find an order-of-magnitude difference in performance between WA Caching and Memcached, but in my experience Memcached is a little faster. Memcached won't be able to beat the "local caching" feature in WA Caching, though, since there's literally no latency on that. (It's in-proc data access without serialization. Just about as efficient as is possible.)




回答2:


It was my misunderstanding that Windows Azure Caching is based on SQL Azure and after taking to correct resources I was able to verify that it sure is inmemory cache. so if you decide to write your own using SQL Azure, that would be much slower the what you are already getting now and same goes with Azure Table storage. [Rest of the comment is removed]




回答3:


You can use the recently released Windows Azure Caching (Preview). It has 5x improvement over the shared caching counterpart.

Link : http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/



来源:https://stackoverflow.com/questions/10352468/azure-alternative-method-to-slow-windows-azure-caching-for-multi-instances

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!