.Net下的分布式缓存 - 分布式缓存同步的实现
003 sp1, Framework 2.0,T2060, 1G内存( 沙加的神舟笔记本;) ), 千兆网卡. 两台机器通过直连线相连. .Net Cache单机测试 : P4 D 3.4G, 768MB 内存. 测试结果, 存取10000个条目的时间: Memcached Set(秒) 1.48 1.37 1.48 1.37 1.46 Get(秒) 2.42 2.42 2.42 2.43 2.42 HttpRuntime.Cache Set(秒) 0.015 0.015 0.015 0.015 0.015 Get(秒) 0.015 0.015 0.015 0.015 0.015 .Net内建缓存测试代码HttpRuntime.Cache protected void Page_Load(object sender, EventArgs e) { int start = 200; int runs = 10000; string keyBase = "testKey"; string obj = "This is a test of an object blah blah es, serialization does not seem to slow things down so much. The gzip compression is horrible horrible performance, so we only use it for very large objects. I have not done any heavy benchma***ng recently"; long begin = DateTime.Now.Ticks; for(int i = start; i < start+runs; i++) { HttpRuntime.Cache.Add(keyBase + i, obj,null,System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(1),System.Web.Caching.CacheItemPriority.Normal,null); } long end = DateTime.Now.Ticks; long time = end - begin; Response.Write(runs + " sets: " + new TimeSpan(time).ToString() + "ms<br />"); begin = DateTime.Now.Ticks; int hits = 0; int misses = 0; for(int i = start; i < start+runs; i++) {
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |