本地 AppFabric 和本地 Memcache - 严格来说性能
在工作中,我们正在讨论专用内存缓存服务器的可能性。两个选择是 Windows AppFabric 缓存服务器和 Memcached。因此,我设置了两项测试,一项针对 AppFabric,一项针对 Memcache。
内存缓存测试 操作系统/设备 Memcache VMWare 设备 在具有 8GB RAM 和 MemCachedDOTnet_2.0 C# API 的四核 VMWare Workstation 中进行虚拟化。
在我将一些对象推入缓存后,我开始计时并获得平均数。
- Put 0-1MS(精度仅到毫秒)
- Get 14-15MS
AppFabric Cache Server 没有虚拟机,因为它都是窗口。四核,8GB 内存。 同样的事情,我在开始工作之前将一些对象推送到缓存中。客户端设置中禁用了本地缓存选项。
- Put 0-1MS(精度仅到毫秒)
- Get 0-1ms(精度仅到毫秒)
现在的问题是我听说 MemCached 非常快,但我认为它比 AppFabric 更快,但 Gets 上不会慢 15ms与 AppFabric 相比。其他人的 AppFabric 和/或 MemCache 性能如何?我只是在寻找 MS 的原始数据和物体大小,或者我应该查看的东西,看看是否可以使这些数字更符合我的期望或设置或检查的选项。
At work we are discussing the possibility for a dedicated in-memory cache server. The two choices are Windows AppFabric Cache Server and Memcached. So I setup two tests, one for AppFabric and one for Memcache.
Memcache tests
OS/Appliance
Memcache VMWare Appliance
Virtualized in VMWare Workstation, Quad Core with 8gb of ram with the MemCachedDOTnet_2.0 C# API.
After I pushed a few objects into cache I started my timings and got on average.
- Put 0-1MS (accuracy was only to milliseconds)
- Get 14-15MS
AppFabric Cache Server
No VM because its all windows. Quad Core with 8gb of ram.
Same thing I pushed a few objects to cache before I started working. Local Cache option was disabled in the client settings.
- Put 0-1MS (accuracy was only to milliseconds)
- Get 0-1ms (accuracy was only to milliseconds)
Now the question is I have heard MemCached is super fast, but I assumed it to be faster then AppFabric, but not 15ms slower on Gets vs AppFabric. What is everyone else's performance for both AppFabric and/or MemCache. I'm just looking for raw numbers of MS and object size or things I should look at to see if I can make the numbers line up more to my expectations or options to set or check on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我看到您已在 Appfabric 上启用本地缓存。启用本地缓存后,缓存客户端会在本地存储对象的引用。这使对象在客户端应用程序的内存中保持活动状态。当应用程序请求该对象时,缓存客户端首先检查该对象是否驻留在本地缓存中。如果是,则立即返回对该对象的引用,而无需联系服务器。如果不存在,则从服务器检索该对象。将对象存储到本地缓存后,您的应用程序将继续使用这些对象,直到它们失效,无论这些对象是否被缓存集群上的另一个客户端更新。因此,对于不经常更改的数据最好使用本地缓存。
由于您启用了本地缓存,因此对象会立即返回,而无需联系集群。如果您的数据经常更改并且您对过时数据的容忍度较低,则应该禁用本地缓存。在禁用本地缓存的情况下,在 Windows Server Appfabric 1.1 上尝试相同的测试。
I see that you have enabled local cache on Appfabric. When local cache is enabled, the cache client stores a reference to the object locally. This keeps the object active in the memory of the client application. When the application requests the object, the cache client first checks whether the object resides in the local cache. If so, the reference to the object is returned immediately without contacting the server. If it does not exist, the object is retrieved from the server. After objects are stored in the local cache, your application continues to use those objects until they are invalidated, regardless of whether those objects are updated by another client on the cache cluster. For this reason, it is best to use local cache for data that changes infrequently.
Since you had local cache enabled, the object was returned immediately without contacting the cluster. If your data changes frequently and you have low tolerance for stale data, you should have local cache disabled. Try the same tests on Windows Server Appfabric 1.1 with local cache disabled.
为什么不测试 Windows 版本的 memcached,以便进行同类比较呢?当您在虚拟机中运行其中一个时,您还将获得额外操作系统的开销。
Why don't you test the windows version of memcached so that you're comparing apples with apples? When you're running one of them in a vm you'll also get the overhead of the extra OS..