C# 您使用哪个 .NET Memcached 客户端,EnyimMemcached 还是 BeITMemcached?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/694928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 13:47:12  来源:igfitidea点击:

Which .NET Memcached client do you use, EnyimMemcached vs. BeITMemcached?

c#asp.netcachingmemcached

提问by Ray

Seems like both EnyimMemcached(https://github.com/enyim/EnyimMemcached) and BeITMemcached(http://code.google.com/p/beitmemcached/) are popular .NET Memcached libraries. Both are reasonably active projects under development and have over a thousand downloads. Trying to figure out which one to use but found competing remarks! I did read another related postbut still want to ask more people on this before making a decision.

似乎EnyimMemcached( https://github.com/enyim/EnyimMemcached) 和BeITMemcached( http://code.google.com/p/beitmemcached/) 都是流行的 .NET Memcached 库。两者都是正在开发中的相当活跃的项目,下载量超过一千次。试图弄清楚该使用哪个,但发现了相互竞争的评论!我确实阅读了另一篇相关文章,但在做出决定之前仍然想询问更多人。

EnyimMemcachedclaims on its project homepage (https://github.com/enyim/EnyimMemcached), that

EnyimMemcached在其项目主页 ( https://github.com/enyim/EnyimMemcached) 上声称,

based on our non-disclosed specially handcrafted in-house performance test we're the fastest C# client ever, using negative amount of system resources, be it memory or CPU time

基于我们未公开的专门手工制作的内部性能测试,我们是有史以来最快的 C# 客户端,使用负数量的系统资源,无论是内存还是 CPU 时间

and

we follow memcached's protocol specification as strictly as no one else: even the memcached guys ask us if they don't understand something

我们像其他人一样严格遵循 memcached 的协议规范:即使是 memcached 的人也会问我们他们是否不明白

While BeITMemcachedclaims on its project wiki page (http://code.google.com/p/beitmemcached/wiki/Features) that

虽然BeITMemcached在其项目 wiki 页面 ( http://code.google.com/p/beitmemcached/wiki/Features) 上声称

We have performed extensive functional testing and performance testing of the BeIT Memcached client and we are satisifed that it is working as it should. When we compared the performance against two other clients, the java port and the Enyim memcached client, our client consumed the least resources and had the best performance. It is also following the memcached protocol specifications more strictly, has the most memcached features, and is still much smaller in actual code size.

我们已经对 BeIT Memcached 客户端进行了广泛的功能测试和性能测试,我们对它的正常工作感到满意。当我们将性能与其他两个客户端(java 端口和Enyim memcached 客户端)进行比较时,我们的客户端消耗的资源最少,性能最好。它也更严格地遵循memcached协议规范,拥有最多的memcached特性,实际代码量仍然要小得多。

So for those who have experience on these or anything similar, which client did you choose to use and possibly why you chose the one you chose?

因此,对于那些在这些或任何类似方面有经验的人,您选择使用哪个客户端,以及可能为什么选择您选择的客户端?

Thank you,

谢谢,

Ray.

射线。

采纳答案by jro

We tested both and found Enyim to perform the best for our expected usage scenario: many (but not millions) cached objects, and millions of cache-get requests (average web site concurrency load = 16-20 requests.)

我们对两者进行了测试,发现 Enyim 在我们预期的使用场景中表现最佳:许多(但不是数百万)缓存对象,以及数百万个缓存获取请求(平均网站并发负载 = 16-20 个请求。)

Our performance factor was measuring the time from making the request to having the object initialized in memory on the calling server. Both libraries would have sustained the job, but the enyim client was preferred in our testing.

我们的性能因素是测量从发出请求到在调用服务器的内存中初始化对象的时间。两个库都可以维持这项工作,但在我们的测试中首选 enyim 客户端。

回答by pablox

I have found Enyim to work the best. It is easy to use, reliable and fast :)

我发现 Enyim 效果最好。它易于使用,可靠且快速:)

回答by user403579

Eniym client's Store() sometimes does not work correctly. It happens when key does not present in cache, for most cases after memcached service restart. This construction:

Eniym 客户端的 Store() 有时无法正常工作。它发生在缓存中不存在密钥时,大多数情况下是在 memcached 服务重启后。这种结构:

        T val = _client.Get<T>(key);
        if (val == null)
        {
            // ... filling val variable ...
            var result = _client.Store(StoreMode.Add, key, val);
            // ... result can be false, sometimes ...
        }

works 50/50. T entity is [Serializable].

工作 50/50。T 实体是 [Serializable]。

回答by rpearsondev

There is a comparison between Enyim and BeIT at sysdot.wordpress.com/2011/03/08/memcached-clients-which-ones-best/

在 sysdot.wordpress.com/2011/03/08/memcached-clients-which-ones-best/ 上有Enyim和 BeIT 的比较