<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>稀饭的国度 &#187; cache</title>
	<atom:link href="http://blog.thematice.com/html/ycategory/cache/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.thematice.com</link>
	<description>发现自己的脑袋不好使了，用blog来记录真的很好用。</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:33:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>基于HTTP协议WEB系统优化</title>
		<link>http://blog.thematice.com/html/y2009/876_%e5%9f%ba%e4%ba%8ehttp%e5%8d%8f%e8%ae%aeweb%e7%b3%bb%e7%bb%9f%e4%bc%98%e5%8c%96.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259f%25ba%25e4%25ba%258ehttp%25e5%258d%258f%25e8%25ae%25aeweb%25e7%25b3%25bb%25e7%25bb%259f%25e4%25bc%2598%25e5%258c%2596</link>
		<comments>http://blog.thematice.com/html/y2009/876_%e5%9f%ba%e4%ba%8ehttp%e5%8d%8f%e8%ae%aeweb%e7%b3%bb%e7%bb%9f%e4%bc%98%e5%8c%96.html#comments</comments>
		<pubDate>Wed, 02 Dec 2009 07:37:28 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Linux  web]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=876</guid>
		<description><![CDATA[&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HTTP1.0 和 HTTP1.1 协议最主要的区别是HTTP1.1协议增加了会话保留时间(Keep-Alive),也就是会话完系统并不会立即关闭连接,他会保留一段时间,也就是apache nginx 或者 squid &#8230;.. 设置的Keep-Alive时间,这样如果在这个时间内客户端再次向服务器发出请求时,服务器和客户端就不需要再次进行TCP3次握手和重新连接.这样就加快了打开速度,但是如果话保留时间(Keep-Alive)设置太长就会使得服务器内存大量消耗系统压力也加大,太短也就没发挥HTTP1.1 协议的优点,这个是个取舍的问题,需要根据自己的需求设置,如果服务器访问量小设置大点没关系,如果访问量大就设置小点. &#160;&#160;&#160;&#160;&#160;&#160;&#160; 因为以前没有很好的理解这点,我的nginx服务器和squid服务器就出现了效率很差的经历.nginx 10G内存 squid 6G内存,这两台服务器每天承受大概20万IP左右的访问量,PV多时接近400万,nginx服务器流量大概是50M每秒,squid流量大概是20M每秒,开始我设置nginx会话保留时间(Keep-Alive)为60秒, keepalive_timeout 60; 运行了一段时间发现8个nginx子进程越来越大,基本每个子进程都有70多M,活动连接也基本都是维持在1W以上,Cacti查看服务器压力也是很不理想,想起以前apache优化经验,把 keepalive_timeout 15; 后.立竿见影,服务器活动连接直接少了一半,nginx子进程也一下子降到30多M,nginx是好了,但squid还是不理想,当时我也没想到squid 有会话保留时间(Keep-Alive)的设置,因为squid服务器响应都是以HTTP1.0 响应,就以为没得HTTP1.1协议的会话保留时间(Keep-Alive)设置,squid服务器速度一直不理想,squidclient -h localhost -p 80 mgr:info查看了下squid运行情况,命中率还是理想,但下面的值就非常大,我查看过CCTV YOUKU 人民网,他们的这个值基本都维持在1000左右,我的squid肯定有问题,当时我也不知道怎么处理.就一直搁在那. Maximum number of file descriptors:&#160;&#160; 51200Largest file desc currently in use:&#160;&#160;&#160;&#160; 13776Number of file desc currently in use:&#160;&#160; 10682 &#160; 一天在看网上一篇博客的时候发现博客里面说squid也可以是设置会话保留时间(Keep-Alive),具体如下: client_persistent_connections onserver_persistent_connections [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/876_%e5%9f%ba%e4%ba%8ehttp%e5%8d%8f%e8%ae%aeweb%e7%b3%bb%e7%bb%9f%e4%bc%98%e5%8c%96.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用lighttpd加速SQUID</title>
		<link>http://blog.thematice.com/html/y2009/866_%e7%94%a8lighttpd%e5%8a%a0%e9%80%9fsquid.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%2594%25a8lighttpd%25e5%258a%25a0%25e9%2580%259fsquid</link>
		<comments>http://blog.thematice.com/html/y2009/866_%e7%94%a8lighttpd%e5%8a%a0%e9%80%9fsquid.html#comments</comments>
		<pubDate>Wed, 02 Dec 2009 02:02:31 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=866</guid>
		<description><![CDATA[看到这个标题，大家也许会觉得奇怪：SQUID本身就是加速软件，lighttpd还怎么加速SQUID？ 方法：用lighttpd+mod_proxy 跑80 端口，指定后端proxy server是127.0.0.1:81，squid改到81端口 lighttpd.conf 相关内容： server.port = 80 proxy.server = ( “/” => ( ( “host” => “127.0.0.1&#8243;, “port” => 81 ) ) ) server.protocol-http11=”disable” 原理更简单：lighttpd使用的writev和sendfile系统调用比squid用的write系统调用效率高很多。参考C10K和Scalable networking PDF中关于writev,sendfile的说明。 实际效果呢：五台最高跑50M的squid server，换lighttpd+squid模式后，高峰长期跑满100M。]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/866_%e7%94%a8lighttpd%e5%8a%a0%e9%80%9fsquid.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Nginx/Lighttpd作为反向代理服务器</title>
		<link>http://blog.thematice.com/html/y2009/778_%e4%bd%bf%e7%94%a8nginxlighttpd%e4%bd%9c%e4%b8%ba%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8nginxlighttpd%25e4%25bd%259c%25e4%25b8%25ba%25e5%258f%258d%25e5%2590%2591%25e4%25bb%25a3%25e7%2590%2586%25e6%259c%258d%25e5%258a%25a1%25e5%2599%25a8</link>
		<comments>http://blog.thematice.com/html/y2009/778_%e4%bd%bf%e7%94%a8nginxlighttpd%e4%bd%9c%e4%b8%ba%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8.html#comments</comments>
		<pubDate>Sat, 24 Oct 2009 17:11:15 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[反向代理]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=778</guid>
		<description><![CDATA[反向代理服务已经越来越广泛的应用于高负载的Web站点中，常用来作为Reverse Proxy的有Squid、Apache、Lighttpd、Nginx等，后两个轻量级的应用因为其优秀的表现已迅速占领了大量市场，本文只讨论后两者的简单应用（用proxy处理静态文件而把动态文件交给后端的Web服务器来处理） 安装环境 操作系统: Debian 4.0 r3 Kernel: 2.6.18-6-686 软件列表 nginx-0.6.31.tar.gz lighttpd-1.4.19.tar.gz 安装过程 安装nginx作为反向代理 # tar zxvf nginx-0.6.31.tar.gz # cd nginx-0.6.31 # ./configure &#8211;prefix=/usr/local/nginx &#8211;with-http_realip_module # make &#038;&#038; make install # vi /usr/local/nginx/conf/nginx.conf location / { proxy_pass http://10.10.10.87/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/778_%e4%bd%bf%e7%94%a8nginxlighttpd%e4%bd%9c%e4%b8%ba%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lighttpd的日志rotate</title>
		<link>http://blog.thematice.com/html/y2009/776_lighttpd%e7%9a%84%e6%97%a5%e5%bf%97rotate.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lighttpd%25e7%259a%2584%25e6%2597%25a5%25e5%25bf%2597rotate</link>
		<comments>http://blog.thematice.com/html/y2009/776_lighttpd%e7%9a%84%e6%97%a5%e5%bf%97rotate.html#comments</comments>
		<pubDate>Sat, 24 Oct 2009 17:09:51 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[rotate]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=776</guid>
		<description><![CDATA[之前找到的通过logrotate计划任务来截断lighttpd的日志目前看起来并不好用，为了更好的解决lighttpd的日志rotate，找到了cronolog。从其网站转载一段说明: cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/776_lighttpd%e7%9a%84%e6%97%a5%e5%bf%97rotate.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lighttpd+modcache实现对小图片的Cache</title>
		<link>http://blog.thematice.com/html/y2009/774_lighttpdmodcache%e5%ae%9e%e7%8e%b0%e5%af%b9%e5%b0%8f%e5%9b%be%e7%89%87%e7%9a%84cache.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lighttpdmodcache%25e5%25ae%259e%25e7%258e%25b0%25e5%25af%25b9%25e5%25b0%258f%25e5%259b%25be%25e7%2589%2587%25e7%259a%2584cache</link>
		<comments>http://blog.thematice.com/html/y2009/774_lighttpdmodcache%e5%ae%9e%e7%8e%b0%e5%af%b9%e5%b0%8f%e5%9b%be%e7%89%87%e7%9a%84cache.html#comments</comments>
		<pubDate>Sat, 24 Oct 2009 16:59:38 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[cache]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[modcache]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/?p=774</guid>
		<description><![CDATA[安装环境 操作系统: CentOS release 5.2 (Final) Kernel: 2.6.18-92.el5PAE 软件列表 fam-latest.tar.gz gamin-0.1.10.tar.gz pcre-7.9.tar.gz lighttpd-1.4.23.modcache.v.1.8.0.tar.gz 软件存放位置 /data/software 安装过程 #cd /data/software/pkg 安装依赖插件pcre, fam, gamin 关于FAM http://oss.sgi.com/projects/fam/faq.html 关于gamin http://www.gnome.org/~veillard/gamin/overview.html See also: http://trac.lighttpd.net/trac/wiki/server.stat-cache-engineDetails #tar zxvf ../pcre-7.9.tar.gz #cd pcre-7.9 #./configure #make &#038;&#038; make install #cd .. #tar zxvf ../fam-latest.tar.gz #cd fam-2.7.0/ #./configure #make &#038;&#038; make install #cd .. #tar zxvf ../gamin-0.1.10.tar.gz [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2009/774_lighttpdmodcache%e5%ae%9e%e7%8e%b0%e5%af%b9%e5%b0%8f%e5%9b%be%e7%89%87%e7%9a%84cache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

