<?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/385/</link>
<title><![CDATA[亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[搜索引擎技术]]></category>
<pubDate>Tue, 09 Dec 2008 00:47:37 +0000</pubDate> 
<guid>http://zyan.cc/post/385/</guid> 
<description>
<![CDATA[ 
	　　[文章作者：张宴 本文版本：v1.0 最后修改：2008.12.09 转载请注明原文链接：<a href="http://blog.zyan.cc/post/385/" target="_blank">http://blog.zyan.cc/post/385/</a>]<br/><br/>　　曾经在七月，写过一篇文章──《<a href="post/360.htm" target="_blank">基于Sphinx+MySQL的千万级数据全文检索（搜索引擎）架构设计</a>》，前公司的分类信息搜索基于此架构，效果明显，甚至将很大一部分带Where条件的MySQL SQL查询，都改用了Sphinx+MySQL搜索。但是，这套架构仍存在局限：一是MySQL本身的并发能力有限，在200～300个并发连接下，查询和更新就比较慢了；二是由于MySQL表的主键与Sphinx索引的ID一一对应，从而无法跨多表建立整站查询，而且新增加类别还得修改配置文件，比较麻烦；三是因为和MySQL集成，无法发挥出Sphinx的优势。<br/><br/>　　最近，我设计出了下列这套最新的搜索引擎架构，目前已经写出“搜索查询接口”和“索引更新接口”的beta版。经测试，在一台“奔腾四 3.6GHz 双核CPU、2GB内存”的普通PC机，7000万条索引记录的条件下，“搜索查询接口”平均查询速度为0.0XX秒（查询速度已经达到百度、谷歌、搜狗、中国雅虎等搜索引擎的水平，详见文章末尾的“附2”），并且能够支撑高达5000的并发连接；而“索引更新接口”进行数据分析、入队列、返回信息给用户的全过程，高达1500 Requests/Sec。<br/><br/>　　“队列控制器”这一部分是核心，它要控制队列读取，更新MySQL主表与增量表，更新搜索引擎数据存储层Tokyo Tyrant，准实时（1分钟内）完成更新Sphinx增量索引，定期合并Sphinx索引。我预计在这周写出beta版。<br/><br/><a href="http://zyan.cc/attachment/200812/search.gif" target="_blank"><img src="http://zyan.cc/attachment/200812/search.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　<span style="font-size: 14px;"><strong>图示说明：</strong></span><br/>　　<strong>1、搜索查询接口：</strong><br/><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/linux/" rel="tag">linux</a> , <a href="http://zyan.cc/tags/php/" rel="tag">php</a> , <a href="http://zyan.cc/tags/sphinx/" rel="tag">sphinx</a> , <a href="http://zyan.cc/tags/search/" rel="tag">search</a> , <a href="http://zyan.cc/tags/tokyotyrant/" rel="tag">tokyotyrant</a> , <a href="http://zyan.cc/tags/ttserver/" rel="tag">ttserver</a> , <a href="http://zyan.cc/tags/tokyocabinet/" rel="tag">tokyocabinet</a> , <a href="http://zyan.cc/tags/mysql/" rel="tag">mysql</a> , <a href="http://zyan.cc/tags/google/" rel="tag">google</a> , <a href="http://zyan.cc/tags/%25E7%2599%25BE%25E5%25BA%25A6/" rel="tag">百度</a> , <a href="http://zyan.cc/tags/%25E8%25B0%25B7%25E6%25AD%258C/" rel="tag">谷歌</a> , <a href="http://zyan.cc/tags/%25E6%2590%259C%25E7%258B%2597/" rel="tag">搜狗</a> , <a href="http://zyan.cc/tags/%25E9%259B%2585%25E8%2599%258E/" rel="tag">雅虎</a> , <a href="http://zyan.cc/tags/%25E6%259C%2589%25E9%2581%2593/" rel="tag">有道</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2162</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>linvo &lt;linvo@126.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 04:34:33 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2162</guid> 
<description>
<![CDATA[ 
	强~不知道那些搜索门户网站的构架怎样
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2164</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>jk &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 04:42:00 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2164</guid> 
<description>
<![CDATA[ 
	怀疑百度显示的时间不是实际检索花费的时间。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2163</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>大菠萝 &lt;web@cc.cc&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 04:46:58 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2163</guid> 
<description>
<![CDATA[ 
	感觉Baidu和Google一样快呀。用FireBug查看页面载入时间。Baidu :165ms，Google:154ms。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2165</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>outrace &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 05:00:39 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2165</guid> 
<description>
<![CDATA[ 
	Sphinx 不支持非int类型的id。这点很讨厌。<br/>ttserver对php内容无法反序列化，不支持压缩，这两点也很讨厌。<br/><br/>要是没有这几个问题就好了。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2167</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>ptubuntu &lt;ruijin.chen@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 06:27:39 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2167</guid> 
<description>
<![CDATA[ 
	对开发程序还是不懂.不过这对我来说可以多学习一些.不过觉的google他们做的比较复杂的.可想而知.
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2170</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>cyt &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 07:24:40 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2170</guid> 
<description>
<![CDATA[ 
	这套东西离google、baidu还差好远好远。。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2174</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>fei &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 09:13:45 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2174</guid> 
<description>
<![CDATA[ 
	有没有这么夸张啊？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2175</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>dugu &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 09:30:23 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2175</guid> 
<description>
<![CDATA[ 
	想用到实践中。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2183</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>cncaiker &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 14:34:25 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2183</guid> 
<description>
<![CDATA[ 
	会发布吗？非常期待
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2184</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>jeck &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 14:49:42 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2184</guid> 
<description>
<![CDATA[ 
	强，佩服的五体投地！更期待在高负荷的生产环境中的数据
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2186</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>dd_macle &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 19:41:02 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2186</guid> 
<description>
<![CDATA[ 
	学习...
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2187</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>gs &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 09 Dec 2008 23:23:26 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2187</guid> 
<description>
<![CDATA[ 
	sina wants to develop his own search engine
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2199</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>ttplay &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 10 Dec 2008 04:03:54 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2199</guid> 
<description>
<![CDATA[ 
	一句话解释:<br/> 一个人将记录写到了缓存,数据库中并更新索引,<br/> 另一个人通过索引从缓存或数据库中读出记录.<br/>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2217</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>plantegg &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 11 Dec 2008 15:19:25 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2217</guid> 
<description>
<![CDATA[ 
	从原理上讲你这个是不可能赶上google/baidu/sogou那些的，虽然看起来和Lucene（Java写得，你也没做任何优化吧）差不多，Lucene搜索结果也是要考虑相关性、排名等等（所以在每篇文章中命中次数是要统计的，不是找到一次就了事），不知道Sphinx有这些没？没有的话这个比较对Lucene太不公平 :)<br/><br/>搜索引擎Cache命中率一般在60%略高的样子，索引所用的内存都是几百G几百G的<br/><br/>你这个只对增量增加敏感，好像删除的话不能更新索引吧？<br/><br/>不过不得不赞一下你这个也相当棒:)
]]>
</description>
</item><item>
<link>http://zyan.cc/post/385/#blogcomment2223</link>
<title><![CDATA[[评论] 亿级数据的高并发通用搜索引擎架构设计[原创]]]></title> 
<author>dd &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 12 Dec 2008 03:36:51 +0000</pubDate> 
<guid>http://zyan.cc/post/385/#blogcomment2223</guid> 
<description>
<![CDATA[ 
	牛，向你学习，虽然现在有些还是看不懂
]]>
</description>
</item>
</channel>
</rss>