<?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; john</title>
	<atom:link href="http://guogoul.com/author/john/feed/" rel="self" type="application/rss+xml" />
	<link>http://guogoul.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 Oct 2010 00:24:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>优化web服务器tcp半连接</title>
		<link>http://guogoul.com/2009/06/23/tcp_tw_reuse/</link>
		<comments>http://guogoul.com/2009/06/23/tcp_tw_reuse/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 15:46:43 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Web开发]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysctrl]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=116</guid>
		<description><![CDATA[在繁忙的web服务器上,很常见的问题是大量tcp 半连接的存在占用系统的大量资源。有效的减少半连接对优化服务器响应有着重要的作用。
实践步骤：
1。执行 /bin/netstat -n &#124; awk &#8216;/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}&#8217;
2。vi /etc/sysctl.conf   添加如下两行:

1)net.ipv4.tcp_tw_reuse = 1     //允许将TIME-WAIT sockets重新用于新的TCP连接
2)net.ipv4.tcp_tw_recycle = 1  //开启TCP连接中TIME-WAIT sockets的快速回收

3。运行sysctl -p

4。执行 /bin/netstat -n &#124; awk &#8216;/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}&#8217;
如果对于TIME_WAIT较高的服务器来说应该很快就会看到效果
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/23/tcp_tw_reuse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>db file sys params</title>
		<link>http://guogoul.com/2009/06/18/db_filesys/</link>
		<comments>http://guogoul.com/2009/06/18/db_filesys/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:42:06 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mount]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=118</guid>
		<description><![CDATA[1. noatime option mount
2.ext3 ？ mke2fs -j -m1
3. tune2fs -c 0 -i 0 
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/18/db_filesys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx静态压缩(ngx_http_gzip_static_module)</title>
		<link>http://guogoul.com/2009/06/14/ngx_http_gzip_static_module/</link>
		<comments>http://guogoul.com/2009/06/14/ngx_http_gzip_static_module/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 12:29:27 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Web开发]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=123</guid>
		<description><![CDATA[在搭建squid网页加速的时候，对于大的css 或者js要进行压缩,然后再进行缓存,这样能够提高减小下载量提高页面响应速度。如果你用的是squid 3.0以前的版本并且用的是 ngnix server的话可能会碰到如下问题： 不用squid直接打开页面则客户端返回的是压缩的状态，如果启用squid加速会发现下载下来的页面不是压缩状态。这里面主要是没有启动ngnix 的静态缓存模块(ngx_http_gzip_static_module)导致。打开静态缓存问题就解决了
1.nginx编译选项
./configure --with-http_gzip_static_module
2.修改nginx.conf

gzip_static on;
gzip_http_version   1.1;
gzip_proxied        expired no-cache no-store private auth;
gzip_disable        "MSIE [1-6] \.";
gzip_vary           on;

参考：
1.http://wiki.nginx.org/NginxHttpGzipStaticModule
2.http://bbs.chinaunix.net/viewthread.php?tid=1329820
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/14/ngx_http_gzip_static_module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>innodb_log_file_size的一个问题</title>
		<link>http://guogoul.com/2009/06/10/innodb_log_file_size/</link>
		<comments>http://guogoul.com/2009/06/10/innodb_log_file_size/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 15:13:08 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[innodb]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=122</guid>
		<description><![CDATA[备份一份mysql的数据到别的机器上的做法最简单的方案是先把运行的mysql关闭，然后把data目录下面的数据copy到别的机器上的mysql data文件夹下面去然后启动两边的mysql做主从备份。
如果数据库中有存在innodb表的话要注意innodb_log_file_size的问题。可能新的mysql启动会报这个错误
090225 23:50:08 [ERROR] /opt/lamp/apps/mysql/libexec/mysqld: Incorrect information in file: &#8216;./user/actor.frm&#8217;
主要是由于 原来的innodb_log_file_size新的参数不一致导致的。把这个参数改成原来的大小就OK了，当然还有其它的更好解决方案：
参考：
1.http://dev.mysql.com/doc/refman/5.0/en/adding-and-removing.html
2.http://qroom.blogspot.com/2007/03/incorrect-information-in-file.html
由于参考2文档需要要翻墙，把部分内容摘下：
=================
更改了innodb的日志文件大小，即innodb_log_file_size的值，重启mysql之后对innodb的表都会报错：[ERROR] /usr/local/mysql/bin/mysqld: Incorrect information in file: &#8216;./a/b.frm&#8217;。解决办法是修改其值后把日志文件ib_logfile删掉再启动mysql（请注意备份）。
注：删log之前确保innodb_fast_shutdown的值不是2，如果是2则需要先改为1，然后重启使之生效，再关闭mysql删log文件。其默认值是1。
=================
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/10/innodb_log_file_size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysqlreport</title>
		<link>http://guogoul.com/2009/06/09/mysqlreport/</link>
		<comments>http://guogoul.com/2009/06/09/mysqlreport/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 16:07:14 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[mysqlreport]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=113</guid>
		<description><![CDATA[要掌握数据库状态，并了解其不足，然后作出一份详细可靠的优化方案，必须对数据库的各个参数进行量化的了解比如cache用了多，数据每秒有多少请求，select与insert的比例各占多少等。对mysql而言最简单的方案是直接show status,不过这些数据十分晦涩枯燥，不容易理解。mysqlreport的报表则易懂得多.
mysqlreport提供了几乎所有的mysql的关键status信息，而且对这些数据做了加工处理理解起来十分的方便。
参考文档：
1.http://hackmysql.com/mysqlreportguide
2.http://hi.baidu.com/xuwanbest/blog/item/f3f8fca1df8e2788461064fe.html
只有亲试之，才会体会其中的妙处
部分结果：

]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/09/mysqlreport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysqldumpslow 参数</title>
		<link>http://guogoul.com/2009/06/04/mysqldumpslow/</link>
		<comments>http://guogoul.com/2009/06/04/mysqldumpslow/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 11:29:15 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[mysqldumpslow]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=117</guid>
		<description><![CDATA[-s ORDER     what to sort by (t, at, l, al, r, ar etc), ‘at’ is default
t: 查询花费时间   l: lock时间    r: 返回的记录数  所有前面的a表示倒序
-r  按输出结果倒序排列
-a  不把字查询字符串与数据改成S,N
-t NUM       just show the top n queries
显示前面几条
-g PATTERN   grep: only consider stmts that include this string后边可以写一个正则匹配模式，大小写不敏感的
-l           don&#8217;t subtract lock [...]]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/04/mysqldumpslow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql存储引擎选择</title>
		<link>http://guogoul.com/2009/06/01/storage_engin/</link>
		<comments>http://guogoul.com/2009/06/01/storage_engin/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 15:16:33 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[myisam]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=121</guid>
		<description><![CDATA[每每建表自问:  用 MyISAM好呢，还是 InnoDB？N多次都是无解
各种存储引擎都有自己的优点。做出什么样的选择，在于你自己的需求

这下好了，所有的选择按这个来吧!
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/01/storage_engin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rsync数据同步利器</title>
		<link>http://guogoul.com/2009/06/01/rsync/</link>
		<comments>http://guogoul.com/2009/06/01/rsync/#comments</comments>
		<pubDate>Sun, 31 May 2009 16:02:44 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://john.renren.in/?p=124</guid>
		<description><![CDATA[对于系统运维人员来说rsync 应该是工具箱中的一个常用工具，其稳定，便捷，高效的特性一直为人所称道.rsync一般会配合cron工作，cron定时自动完成系统数据同步工作。
1.决定使用哪种传输协议？
在默认条件下，rsync可以用RSH协议与远程系统进行通信。通过调整参数还可以用SSH协议，这样就可利用所有的标准SSH认证方法，并实现加密的文件传输。建议用ssh协议
2.基本应用
试验rsync的时候应该非常小心，因为很可能一不小心就将大量数据发送到它们本不该出现的地方。 verbose(-v)与dry-run(-n)在你试验的时候将会十分的有用，verbose能让你看到修改的结果，dry-run就是不对文件进行真正的修改主，只产生结果信息。
注意： 文件夹参数后面有/与没有/的区别。如果源目录有/表示当前目录下的所有文件 ，如果没有/表示当前文件夹也包括其中
-a:  以归档的模式进行操作，这将导致rsync以递归方式运行，并保留权限，所有权，符号链接，设备文件，访问时间等信息，等同于： -rlptgoD先项的作用

3.实例：
rsync -a /usr/local     root@remote_host:/usr/local
rsync -a /usr/local/     root@remote_host:/usr/local
注意上面两个结果是不同的 前者local与远程机器的同步，后者会出现本地/usr/local与远程/usr/local/local进行同步
参考：
Rsync详解： http://blog.chinaunix.net/u/25100/showart_363397.html
官网： http://rsync.samba.org/
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/06/01/rsync/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux nfs配置概要</title>
		<link>http://guogoul.com/2009/02/06/nfs/</link>
		<comments>http://guogoul.com/2009/02/06/nfs/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 16:08:30 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://www.guogoul.com/2009/02/06/nfs/</guid>
		<description><![CDATA[利用nfs 可以共享系统中的指定文件夹给网络中的其它机器。我们经常可以利用nfs对系统空间进行扩容
nfs的构成分成两个部份
1.被分享的目录的机器通常称之为nfs server
2.连接nfs的通常称之为nfs client
配置nfs server端：
1.在/etc/exports文件中增加一条要分享目录的分享属性例如:
/home/work 192.168.0.*（rw,sync,no_root_squash）
把本机/home/work目录共享给192.168.0.*IP段内的机器，有读写权限
2./etc/rc.d/init.d/portmap start 启动端口映射
3./etc/rc.d/init.d/nfs start 启动nfs
配置nfs客户端：
很简直，像用正常磁盘一样挂载就行了
mount –t nfs 192.168.0.20:/home/work /mnt
运行上面的指令后客户端就可以直接用/mnt文件夹访问nfs server上的/hom/work文件夹了
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/02/06/nfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>lvm之逻辑卷大小调整</title>
		<link>http://guogoul.com/2009/02/05/lvm_resize/</link>
		<comments>http://guogoul.com/2009/02/05/lvm_resize/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 15:21:54 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[lvm]]></category>

		<guid isPermaLink="false">http://www.guogoul.com/2009/02/05/lvm_resize/</guid>
		<description><![CDATA[使用LVM的最大好处可以动态的改变逻辑磁盘的大小
假设：lv的name为 /dev/main/www
增加大小： lvextend
1.调整/dev/main/www的大小为12G
lvextend -L12G /dev/main/www
2.增加12G
lvextend -L+12G /dev/main/www
单位除了G之外还有kKmMgtT等
当lv扩展之后，还要进行文件系统的调整
如果是reiserfs文件系统
则resize_reiserfs -f /dev/main/www
如果是ext2或者ext3则用ext2resize
操作的时候最好先umount文件系统
减小大小：lvreduce
1.umount 文件系统
2.调整文件系统大小：resize_reiserfs -s-2G /dev/main/www
3.减少逻辑磁盘大小：lvreduce -L-2G /dev/main/www
4.mount逻辑磁盘
]]></description>
		<wfw:commentRss>http://guogoul.com/2009/02/05/lvm_resize/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

