<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/post/320/</link>
<title><![CDATA[新浪发起的UNIX开源软件项目]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[Cache与存储]]></category>
<pubDate>Thu, 10 Jan 2008 00:45:14 +0000</pubDate> 
<guid>http://zyan.cc/post/320/</guid> 
<description>
<![CDATA[ 
	　　<strong><span style="font-size: 14px;">Memcachedb</span></strong><br/><br/>　　协议：<a href="http://www.opensource.org/licenses/bsd-license.php" target="_blank">New BSD License</a> <br/>　　作者：stvchu, gary.caokai, forever.sky81 <br/>　　团队：新浪互动社区事业部──博客产品<br/>　　网址：<a href="http://www.memcachedb.org/" target="_blank">http://www.memcachedb.org/</a><br/><br/>　　Memcachedb = memcache + Berkeley DB<br/><br/>　　Memcachedb是一款支持高并发的分布式持久存储系统，对任何原有memcached客户端来讲，它仍旧是个memcached，但是，它的数据是可以持久存储的。<br/>　　前端：memcached的网络层<br/>　　后端：Berkeley DB存储<br/><br/>　　写速度：从本地服务器通过memcache客户端（libmemcache） set 2亿条16字节长的key，10字节长的Value的记录，耗时16572秒，平均速度12000条记录/秒。<br/>　　读速度：从本地服务器通过memcache客户端（libmemcache） get 100万条16字节长的key，10字节长的Value的记录，耗时103秒，平均速度10000条记录/秒。<br/><br/>　　• 支持的memcache命令<br/>　　get, set, add, replace <br/>　　incr, decr <br/>　　delete <br/>　　stats <br/>　　flush_all <br/><br/>　　• 私有命令<br/>　　db_checkpoint, db_archive <br/>　　db_ismaster, db_whoismaster (for replication) <br/><br/>　　编译及安装方法：<br/>　　<a href="http://blog.csdn.net/simonlsy/archive/2008/01/07/2027940.aspx" target="_blank">http://blog.csdn.net/simonlsy/archive/2008/01/07/2027940.aspx</a><br/><br/>　　<a href="http://zyan.cc/attachment/200801/memcachedb.jpg" target="_blank"><img src="http://zyan.cc/attachment/200801/memcachedb.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/><hr/><br/>　　<strong><span style="font-size: 14px;">ncache</span></strong><br/><br/>　　协议：<a href="http://www.opensource.org/licenses/bsd-license.php" target="_blank">New BSD License</a> <br/>　　作者：shinepf, shuiyang<br/>　　团队：新浪互动社区事业部──博客产品<br/>　　网址：<a href="http://code.google.com/p/ncache/" target="_blank">http://code.google.com/p/ncache/</a><br/><br/>　　ncache是一款基于nginx的缓存系统，比Squid更快更高效。<br/><br/>　　01<br/>　　<a href="http://zyan.cc/attachment/200801/ncache01.jpg" target="_blank"><img src="http://zyan.cc/attachment/200801/ncache01.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/linux/" rel="tag">linux</a> , <a href="http://zyan.cc/tags/cache/" rel="tag">cache</a> , <a href="http://zyan.cc/tags/nginx/" rel="tag">nginx</a> , <a href="http://zyan.cc/tags/tcp/" rel="tag">tcp</a> , <a href="http://zyan.cc/tags/memcached/" rel="tag">memcached</a> , <a href="http://zyan.cc/tags/memcachedb/" rel="tag">memcachedb</a> , <a href="http://zyan.cc/tags/ncache/" rel="tag">ncache</a> , <a href="http://zyan.cc/tags/epoll/" rel="tag">epoll</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment577</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>乐百氏 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 03:26:38 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment577</guid> 
<description>
<![CDATA[ 
	memcachedb，关注它比较长时间了，总体感觉：鸡肋<br/>ncache有意思，不过，bug不少。<br/>希望实现其rfc2616关于cache部分的描述。支持Expire等。<br/><br/>#####################<br/>-----------------Build dir /tmp/data-------------------------------<br/> <br/> <br/>/bin/chown: 参数太少<br/>请尝试执行‘/bin/chown --help’来获取更多信息。<br/> <br/>-----------------Build dir cachedir-------------------------------<br/> <br/>./mkdir_ngx_cache.sh: line 36: [: too many arguments<br/>/bin/chown: 参数太少<br/>请尝试执行‘/bin/chown --help’来获取更多信息。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment578</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>乐百氏 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 03:48:58 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment578</guid> 
<description>
<![CDATA[ 
	ncache貌似还不能缓存。<br/><br/>如下情况还是不能被缓存阿。已经包含了：（Cache-Control: max-age=8640000）<br/>HTTP/1.1 200 OK<br/>Server: nginx/0.5.34<br/>Date: Thu, 10 Jan 2008 03:54:26 GMT<br/>Content-Type: text/html<br/>Connection: keep-alive<br/>ID: 12345678<br/>Set-Cookie: 1234555<br/>Cache-Control: max-age=8640000<br/>Content-Length: 217
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment579</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>代码罐头 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 04:53:56 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment579</guid> 
<description>
<![CDATA[ 
	想不到新浪里面还是有很多前瞻性的开发项目.<br/>能有这样的团队真的很不错.<br/>可以写自己喜欢的代码和做很多实验.<br/>看来有了前进的目标了.<br/>项目除了在GOOGLE CODE上开.<br/>有没有放到SF上?<br/>那里能得到更多协助.
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment580</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>lizongbo &lt;lizongbo@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 10:34:58 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment580</guid> 
<description>
<![CDATA[ 
	我曾经打算拿java版的 Berkeley DB 和apache mina 来做java版的memched ,不过还没动手实现.<br/><br/>新浪有的缓存用的所谓的 CachePower,把 squid改了名字,却连 X-Squid-Error 都没改,显得不厚道!<br/><br/>比如:<a href="http://218.30.66.101/" target="_blank">http://218.30.66.101/</a> <br/><br/><br/>Generated Thu, 10 Jan 2008 10:34:00 GMT by xa-176.sina.com.cn (CachePower/1.3.1.dev)<br/><br/><br/>HTTP/1.x 403 Forbidden<br/>Server: CachePower/1.3.1.dev<br/>Mime-Version: 1.0<br/>Date: Thu, 10 Jan 2008 10:34:00 GMT<br/>Content-Type: text/html<br/>Content-Length: 1063<br/>Expires: Thu, 10 Jan 2008 10:34:00 GMT<br/>X-Squid-Error: ERR_ACCESS_DENIED 0<br/>X-Cache: MISS from xa-176.sina.com.cn<br/>Connection: close
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment581</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>代码罐头 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 14:03:56 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment581</guid> 
<description>
<![CDATA[ 
	JAVA的话性能可以满足么?<br/>这种底层程序.本来就很讲求性能吧<br/>好的程序甚至需要调整内核性能来满足应用的性能.<br/>改名字只是表面<br/>一样没有改反馈信息也是表面<br/>很多东西.比如内部性能.只有开发人员才知道了
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment582</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>非狐外传 &lt;feihu.roger@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 Jan 2008 16:54:21 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment582</guid> 
<description>
<![CDATA[ 
	ncache不知道和varnishd比有什么特色
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment588</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>outrace &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sat, 12 Jan 2008 01:06:25 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment588</guid> 
<description>
<![CDATA[ 
	楼主最好可以给一个ncache的配置例子。<br/><a href="http://code.google.com/p/ncache/wiki/HowToUseNCache" target="_blank">http://code.google.com/p/ncache/wiki/HowToUseNCache</a><br/>这个上面没有完整的配置信息（比如fcgi的配置）<br/><br/>然后给一个ncache和varnish的性能比较看看。<br/>hooo。谢谢
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment601</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>freeway &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 16 Jan 2008 01:34:28 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment601</guid> 
<description>
<![CDATA[ 
	memcachedb的客户端怎么没有？是不是就用memcached的客户端就可以访问memcachedb的服务？请问是这样吗？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment605</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>sofire &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 17 Jan 2008 15:15:07 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment605</guid> 
<description>
<![CDATA[ 
	memcachedb 最大的应用是用来做点击数的存储。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment606</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>pangfan &lt;shineyear@msn.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 17 Jan 2008 16:28:35 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment606</guid> 
<description>
<![CDATA[ 
	谢谢大家对NCACHE的关心,在这里也非常感谢楼主的关注!<br/>回复 outrace :NCACHE本身不支持FCGI,本来NGINX是支持的，不过我们只提取NGINX的核心模块,有很多功能都去掉了.varnish我们之前做过测试,效果并不好,尤其是跑了一段时间之后性能急剧下降,而且它是一种纯内存CACHE,相比来说NCACHE目前的版本还不具备内存CACHE功能,等NCACHE的内存CACHE功能出来后,我们会进行一个比较详细的生产环境测试和比较,谢谢<br/><br/>回复 乐百氏: 谢谢你提出了这个BUG,SIMON同学已经根据你的描述修改了这个SH文件,谢谢. 目前新的版本中NCACHE已经将MAX-AGE自动转为了分钟,最大支持65535分钟的缓存过期时间,超过的就全都按这个时间来计算, 8640000(100天不过期) 是不是大了点?不用这么设置吧?我们公司最大设置才30天左右,够用就好~.ncache 确实不支持RFC的很多描述,因为我们本来就是想让它成为一个完全定制的,精简的小系统,这也是我们为什么更快的原因之一,谢谢
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment607</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>乐百氏 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 18 Jan 2008 03:17:20 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment607</guid> 
<description>
<![CDATA[ 
	to：pangfan<br/>谢谢，诚恳的答复
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment610</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>gyro &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 21 Jan 2008 06:30:28 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment610</guid> 
<description>
<![CDATA[ 
	sofire 2008-1-17 23:15 <br/>memcachedb 最大的应用是用来做点击数的存储。 <br/>================================<br/><br/>其实是适合对于点状数据，无关联的数据存储，点击量只是其中一种，如果以这个来做文章的存储，然后用另外的关系数据库存储文章的关系，就挺合适的，只是不知道这样的性能会不会下降了
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment620</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>代码罐头 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 24 Jan 2008 06:21:33 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment620</guid> 
<description>
<![CDATA[ 
	为什么不将网站程序放在tmpfs下<br/>然后用nginx直接做对外服务呢<br/>varnish或者squid都是利用内存和它的连接数来做到加速服务.<br/>但是如果是squid-&gt;nginx-&gt;fastcgi-&gt;mysql<br/>这样当中很多连接是开销在内部的连接之中<br/>而且如果客户端请求php.squid还需要将请求再转发至nginx,然后nginx再转发至fastcgi<br/>对于动态内容的多加了一个步骤.<br/>考虑到nginx有了不低于squid以及varnish的连接能力<br/>那么可以将网站程序直接放在tmpfs中<br/>这样如果是静态的.就会直接从内存读取后返回给用户(和其他缓冲服务器的效果一样)<br/>如果是PHP就丢给后面的fastcgi处理<br/>这样更快.<br/><br/>至于程序同步的问题.<br/>在程序更新的时候使用svn或者rsync去同步tmpfs里面和文件服务器中的内容就可以了<br/><br/>至于服务器重启tmpfs清空的问题<br/>只需要在服务器重启之前,需要将内存中的程序复制到本地硬盘<br/>然后启动之后,将硬盘数据再复制到tmpfs中然后启动服务即可<br/><br/>至于服务器宕机以后无法事先保存tmpfs内容<br/>既然服务器都挂了.在它启动之后用10分钟20分钟把程序全部重新同步过来也不是什么大的开销.<br/>如果是多节点的负载均衡或者HA,那就更没必要担心tmpfs内容丢失的问题.<br/><br/>至于上传文件<br/>如果你都用这么样的架构来加速了.<br/>你的图片还会直接上传到web服务器么?<br/>肯定是直接传到图片服务器了.
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment779</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>Chanix &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 13 Mar 2008 02:45:21 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment779</guid> 
<description>
<![CDATA[ 
	是否支持内存式缓存，我觉得不是太重要，可以通过 /dev/shm 这些内存文件系统来模拟，效率上的差别很小。<br/><br/>我觉得最重要的是利用 nginx 的功能，在硬盘上保存缓存数据，提供最大的并发请求和吞吐。squid 在缓存文件个数多了以后，效率下降的比较厉害。<br/><br/>纯内存的 cache 非常有用，但内存是有限的稀缺资源（别和我说现在内存便宜，我现在用的CACHE机都是16G插满的内存），可能对 web 页面等比较适合，但是对于图片等大字节的东西就不太适合了。我目前也只在静态专区上使用这种方式。图片？动不动就上几百G的量，不可能了。<br/><br/>而图片恰恰是同步最麻烦的，如果 ncache 能和 squid 一样，自动拉和保存大量的缓存文件，并提供优秀的吞吐量，我觉得就可以满足我对缓存的需要了。<br/><br/>varnish 我也测试过，感觉不太稳定，有跑着跑着就崩掉的现象，当时我测试时用的版本是 1.0.x 的，新版本的没测试过，不敢乱说，应该在稳定性上有提高。<br/><br/>术数有专攻，在 ncache 中集合太多的功能，感觉不好，还是做精来的合适。<br/><br/>另：为什么 ncache 不作为 nginx 的一个补丁来开发？这样可以集成到nginx里面，让用户在编译时选择?
]]>
</description>
</item><item>
<link>http://zyan.cc/post/320/#blogcomment854</link>
<title><![CDATA[[评论] 新浪发起的UNIX开源软件项目]]></title> 
<author>影之迷惑 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sat, 29 Mar 2008 16:26:47 +0000</pubDate> 
<guid>http://zyan.cc/post/320/#blogcomment854</guid> 
<description>
<![CDATA[ 
	安装最新的 1.0.3 错误信息：<br/><br/>[root@localhost memcachedb-1.0.3]# make<br/>make &nbsp;all-recursive<br/>make[1]: Entering directory &#96;/usr/local/src/bdb/memcachedb-1.0.3&#039;<br/>Making all in doc<br/>make[2]: Entering directory &#96;/usr/local/src/bdb/memcachedb-1.0.3/doc&#039;<br/>make[2]: Nothing to be done for &#96;all&#039;.<br/>make[2]: Leaving directory &#96;/usr/local/src/bdb/memcachedb-1.0.3/doc&#039;<br/>Making all in tools<br/>make[2]: Entering directory &#96;/usr/local/src/bdb/memcachedb-1.0.3/tools&#039;<br/>make[2]: Nothing to be done for &#96;all&#039;.<br/>make[2]: Leaving directory &#96;/usr/local/src/bdb/memcachedb-1.0.3/tools&#039;<br/>make[2]: Entering directory &#96;/usr/local/src/bdb/memcachedb-1.0.3&#039;<br/>gcc -DHAVE_CONFIG_H -I. &nbsp; -I/usr/local/BerkeleyDB.4.6/include &nbsp; -g -O2 -MT memcachedb.o -MD -MP -MF .deps/memcachedb.Tpo -c -o memcachedb.o memcachedb.c<br/>memcachedb.c: 在函数 ‘do_store_item’ 中：<br/>memcachedb.c:696: 错误：‘DB’ 没有名为 ‘exists’ 的成员<br/>memcachedb.c: 在函数 ‘process_stat’ 中：<br/>memcachedb.c:885: 错误：‘DB_REPMGR_SITE’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:885: 错误：(即使在一个函数内多次出现，每个未声明的标识符在其<br/>memcachedb.c:885: 错误：所在的函数内只报告一次。)<br/>memcachedb.c:885: 错误：‘list’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:895: 错误：‘DB_ENV’ 没有名为 ‘repmgr_site_list’ 的成员<br/>memcachedb.c:921: 错误：‘DB_ENV’ 没有名为 ‘rep_get_priority’ 的成员<br/>memcachedb.c:924: 错误：‘DB_ENV’ 没有名为 ‘repmgr_get_ack_policy’ 的成员<br/>memcachedb.c:927: 错误：‘DB_ENV’ 没有名为 ‘rep_get_timeout’ 的成员<br/>memcachedb.c:927: 错误：‘DB_REP_ACK_TIMEOUT’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:930: 错误：‘DB_ENV’ 没有名为 ‘rep_get_config’ 的成员<br/>memcachedb.c:930: 错误：‘DB_REP_CONF_BULK’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c: 在函数 ‘process_rep_command’ 中：<br/>memcachedb.c:1377: 错误：‘DB_REPMGR_SITE’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:1377: 错误：‘list’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:1394: 错误：‘DB_ENV’ 没有名为 ‘repmgr_site_list’ 的成员<br/>memcachedb.c:1417: 错误：‘DB_ENV’ 没有名为 ‘rep_set_priority’ 的成员<br/>memcachedb.c:1433: 错误：‘DB_ENV’ 没有名为 ‘repmgr_set_ack_policy’ 的成员<br/>memcachedb.c:1449: 错误：‘DB_ENV’ 没有名为 ‘rep_set_timeout’ 的成员<br/>memcachedb.c:1449: 错误：‘DB_REP_ACK_TIMEOUT’ 未声明 (在此函数内第一次使用)<br/>memcachedb.c:1464: 错误：‘DB_ENV’ 没有名为 ‘rep_set_config’ 的成员<br/>memcachedb.c:1464: 错误：‘DB_REP_CONF_BULK’ 未声明 (在此函数内第一次使用)<br/>make[2]: *** [memcachedb.o] 错误 1<br/>make[2]: Leaving directory &#96;/usr/local/src/bdb/memcachedb-1.0.3&#039;<br/>make[1]: *** [all-recursive] 错误 1<br/>make[1]: Leaving directory &#96;/usr/local/src/bdb/memcachedb-1.0.3&#039;<br/>make: *** [all] 错误 2<br/>[root@localhost memcachedb-1.0.3]# <br/><br/><br/>不知道怎么回事，请赐教。
]]>
</description>
</item>
</channel>
</rss>