问题描述
我已经实现了一个缓存接口和memchanged提供商使用enyim我们的网站。直到我们到达负载测试,它尖峰的w3wp.exe至接近100%的CPU工作在测试大。我们有一个配置属性缓存提供商切换回的dotnet的API和CPU回到5-7%。有没有人遇到过类似的?
I've implemented a caching interface and memchanged provider for our website using enyim. Works great in testing until we get to load testing, where it spikes the CPU of w3wp.exe to near 100%. We have a configuration property to switch the caching provider back to dotnet's API and the CPU goes back to 5-7%. Has anyone experienced similar?
推荐答案
您存储在memcached的东西通过enyim每一次,.NET运行时将储存的对象执行二进制序列化。当您检索反序列化。对于一些类型(字符串,字节[]和更多一些),enyim实现了更具体的,重量轻的序列,但大多数类型由标准的BinaryFormatter序列化。这是处理器密集型。
Every time you store something in memcached through enyim, the .NET runtime will perform binary serialization on the stored object. And deserialization when you retrieve. For some types (string, byte[] and some more), enyim implements a more specific and light weight serialization, but most types are serialized by the standard BinaryFormatter. This is processor intensive.
这尤其会伤害你时,code朝向内存中缓存在ASP.NET编写的。你可能会有code,它认为从缓存中得到的东西是免费的。您可以从缓存中一而再,再而再次得到它。我们有可比性问题,当我们切换到memcached的。如果你做了一些分析,你可能会发现你做很多疯狂的从缓存中读取。
It especially hurts when your code is written towards the in-memory cache in ASP.NET. You will probably have code that thinks that getting something from cache is free. You may get it from cache again and again and again. We had comparable problems when we switched to memcached. If you do some profiling, you'll probably find that you do insanely many reads from cache.
我们与客户enyim的经验是非常积极的。我们运行memcached围绕10个节点的ASP.NET服务器群中,这是非常稳定的。对于某些形式的数据(经常访问),我们preFER的。
Our experiences with the enyim client have been very positive. We run memcached in an ASP.NET server farm on around 10 nodes and it is very stable. For some forms of data (very often accessed), we prefer the in-process caching of ASP.NET.
这篇关于Enyim memcached的提供商CPU秒杀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!