<?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"
	>

<channel>
	<title>《Ourlinux》杂志</title>
	<atom:link href="http://www.ourlinux.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ourlinux.net</link>
	<description>free的人写的free的杂志^_^</description>
	<pubDate>Thu, 14 Aug 2008 02:03:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<item>
		<title>修复jpeg-6b的一个bug</title>
		<link>http://www.ourlinux.net/operation-tips/fix-a-jpeg-6b-bug/</link>
		<comments>http://www.ourlinux.net/operation-tips/fix-a-jpeg-6b-bug/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 02:03:32 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[FAQ]]></category>

		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[jpeg]]></category>

		<category><![CDATA[jpeg-6b]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=408</guid>
		<description><![CDATA[记得一年前发现很多手机上传的照片经过打水印后会损坏图片，后来经过多方搜索，终于找到了解决方案，当时解决后就没做一下记录，时隔一年，终于又要用到，可一时找不到解决方法，突然想起当年打包（rpm）时还留下源码，于是去jpeg-6b下的源代码进行md5比对，终于找到jdmarker.c该文件做过一些修改，赶紧记录：
修改如下：

/*
 * WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
*/

其实就是注释掉这段代码而已。

    
    
		a2a_linkname="修复jpeg-6b的一个bug";
		a2a_linkurl="http://www.ourlinux.net/operation-tips/fix-a-jpeg-6b-bug/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/fix-a-jpeg-6b-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>预先在存储节点上建立2级目录</title>
		<link>http://www.ourlinux.net/storage/bdfs/create-dir-for-storage-oss/</link>
		<comments>http://www.ourlinux.net/storage/bdfs/create-dir-for-storage-oss/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 02:19:00 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[BDFS]]></category>

		<category><![CDATA[存储]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=407</guid>
		<description><![CDATA[预先在存储节点上建立2级目录是个好方法，可以提高程序的执行效率，少了目录是否存在的判断。
同时也减少磁盘io的压力，毕竟一次性建好目录，以后是不会去调整的。

    
    
		a2a_linkname="预先在存储节点上建立2级目录";
		a2a_linkurl="http://www.ourlinux.net/storage/bdfs/create-dir-for-storage-oss/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/storage/bdfs/create-dir-for-storage-oss/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Q4M</title>
		<link>http://www.ourlinux.net/operation-tips/q4m/</link>
		<comments>http://www.ourlinux.net/operation-tips/q4m/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 02:13:30 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[Softs]]></category>

		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[GPL]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[queue]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=406</guid>
		<description><![CDATA[What is Q4M?
Q4M (Queue for MySQL) is a message queue licensed under GPL that works as a pluggable storage engine of MySQL 5.1, designed to be robust, fast, flexible. The development started in late December of 2007, and although it is very primitive, operates quite swiftly.
To start using Q4M, download either a binary or source [...]]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/q4m/feed/</wfw:commentRss>
		</item>
		<item>
		<title>获取教育网IP段</title>
		<link>http://www.ourlinux.net/operation-tips/get-cernet-ip/</link>
		<comments>http://www.ourlinux.net/operation-tips/get-cernet-ip/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 06:14:48 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[cernet]]></category>

		<category><![CDATA[edu]]></category>

		<category><![CDATA[教育网]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=405</guid>
		<description><![CDATA[做DNS要更新各SP的网段，下面简单的总结一下早上获取教育网的经过。
其实很简单，首先去教育网官方去获取最新的IP段：
只要下载：http://www.nic.edu.cn/RS/ipstat/ 这个url里的数据，然后进行分析（可惜这个url必须在教育网内才可以正常访问）。
内容如下：

CERNIC IP Allocation
Last update: 20080704
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
region=BJ
162.105/16, 166.111/16, 202.4.128/19,
202.112.64/18, 202.112.128/17, 202.113/16, 202.204/14, 210.31/16, 211.68/16, 211.71/16,
211.81/16, 211.82/16, 219.242/16, 219.243.0/17, 219.243.128/18,
219.224.0/17, 219.224.128/18, 219.225/16, 219.226/16, 222.28/14,
222.199/16, 59.64/14, 203.91.120/21, 121.193/16, 121.194/15,
118.228/15, 118.230/16, 121.52.160/19, 115.24/14
region=XA
202.117/16, 202.200/15, 210.26/15, 218.195/16, 219.244/14, 222.23/16, 222.24/15,
59.74/15, 59.76/16, 120.95/16
region=CD
202.115/16, 202.202/15, 210.40/15, 211.83/16, 218.194/16, 219.221/16, 222.18/15, 222.196/15, 222.198/16, 121.48/15, 120.94/16
region=GZ
202.38.192/18, 202.116/16, 202.192/15, 210.36/14, 211.66/16, 218.192/16, 219.222/15, 219.227/16,
222.16/15, 222.200/14, [...]]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/get-cernet-ip/feed/</wfw:commentRss>
		</item>
		<item>
		<title>web 2.0海量小文件cache集群探讨[转载]</title>
		<link>http://www.ourlinux.net/operation-tips/web20-small-file-cache-cluster/</link>
		<comments>http://www.ourlinux.net/operation-tips/web20-small-file-cache-cluster/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 09:58:00 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[cache]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[squid]]></category>

		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=404</guid>
		<description><![CDATA[web 2.0海量小文件cache集群探讨(原创)
msn:gusingchen@hotmail.com
在互联网快速发展的背景下，特别是we2.0，网络上的数据内容呈几何级的增长，而其中增长最快并且最容易给技术架构带来挑战的就是数目庞大的小文件，如 何来解决这种高并发，大流量，小文件，热点不集中的问题，经过我们大量研究，实践之后，总结出这种海量小文件，高并发所存在的关键问题和解决方案。
我们先对比一下在web1.0的解决方案和web2.0的我们碰到的困难。
Web1.0
1、源数据量小，单台squid即可达到很高的命中率。
2、请求量大，用lvs+squid或者dns轮询即可解决问题。
3、squid服务器磁盘IO压力大，用超大内存做cache。
web 2.0
目前的瓶颈:
1、源数据数量很大，导致squid hash table 索引效率不高，Cache 命中率低。
为了提高对文件的访问效率，往往会在前端配置一个稍大容量的缓存。但由于小文件的数量极其庞大，应用对这些文件访问的随机性非常高，使得Cache 命中率极低，缓存失去了应有的作用，导致应用需要直接到后端存储系统上读取数据，给存储系统带来了极大的压力。刚开始就是我们也采用了昂贵的高端存储系统 NetApp，但是在用户高并发访问的情况下，存储系统经常出现长时间无响应的严重故障。
2、源数据容量巨大，海量文件检索效率低，从而也导致单台squid命中率很低。
有些频道数据容量会超过200T，单台squid只是杯水车薪，频繁的cache置换更是加剧了cache效率低下，再加上现有的存储系统无法有效管理海 量小文件，并且在单个目录下存放文件的数量有一定的限制，一旦文件数到达了一定规模之后，文件的检索速度就急剧下降。我们只能通过多级目录来组织存放大量 的小文件，随着目录深度的增加，文件的检索开销进一步增大，检索效率随之下降。
3、大量的cache导致的磁盘IO问题
由于目前单台cache容量已经达到上百G，文件系统瓶颈、磁盘IO问题也很快凸显。
4、压力过大导致的hit　ratio抖动
cache 删除，写操作达到一定的比例,同时如果压力较高，会导致hit ratio呈线性下降。即使cache没down，但也因为命中率的下降而失去应有的作用。
5、特殊集群下的单台失效问题
在类url hash的集群下，单台cache失效会导致hash rehash，那么整个集群的squid命中率都会被冲击。
如何来解决这些问题，思路如下：
1、优化squid hash table 索引算法,
需要修改源squid代码
2、cache集群，用类url hash的方法，以增加cache容量
1)、wccp: cisco的路由器均有此功能
2)、carp: ISA,squid自身的7层调度协议
3)、url hash: nginx haproxy等7层代理
3、选择合适的文件系统
XFS使用更多的内存来作为自己的高速缓存，以尽可能的延迟零散的写操作，尽可能的执行批量写操作。
4、选择更合理的磁盘搭配策略，比如Raid策略或者单盘策略等
Raid 5，10 带来了不错的安全性，但是会导致磁盘IO效率低下，不做Raid的单盘性能最高，更适合单台服务器多squid进程模式。
5、集群下的单台cache失效的接管，以免单点故障，提高可用性。
针对以上分析，我们大量尝试了开源的一些产品，像LVS，Nginx，Squid，XFS等。
具体的软件组合和架构如下：
（1）、web服务器的选择，目前，大多数web服务器的处理能力有限，互联网广泛上使用的web服务器如Apache，其并发能力往往在2000以下， 这是由web服务器自身的设计模式（如多进程，无IO缓存等）决定的。因此，在较大规模的访问情况下，通常会表现出用户访问网站慢，web 服务器负载高。为什么选择Nginx? use linux epoll, sendfile and aio to improve the performanc，我们主要利用的是Nginx的第三方模块ngx_http_upstream_hash_module做反向代理。
部分代码如下：
upstream img{
server squid1:81;
server squid2:81;
hash        $request_uri;
hash_again   0;   [...]]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/web20-small-file-cache-cluster/feed/</wfw:commentRss>
		</item>
		<item>
		<title>周末早餐</title>
		<link>http://www.ourlinux.net/life/weekend-breakfast-01/</link>
		<comments>http://www.ourlinux.net/life/weekend-breakfast-01/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 02:07:52 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[生活日志]]></category>

		<category><![CDATA[早餐]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=403</guid>
		<description><![CDATA[今天早餐：
&#124;
昨日早餐：
&#124;

    
    
		a2a_linkname="周末早餐";
		a2a_linkurl="http://www.ourlinux.net/life/weekend-breakfast-01/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/life/weekend-breakfast-01/feed/</wfw:commentRss>
		</item>
		<item>
		<title>赤壁</title>
		<link>http://www.ourlinux.net/life/chibi/</link>
		<comments>http://www.ourlinux.net/life/chibi/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 16:06:26 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[生活日志]]></category>

		<category><![CDATA[电影]]></category>

		<category><![CDATA[赤壁]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=402</guid>
		<description><![CDATA[刚看完《赤壁》回来，总的来说还不错，好歹也是国内顶尖的制作班子的作品，还是值得一看！


    
    
		a2a_linkname="赤壁";
		a2a_linkurl="http://www.ourlinux.net/life/chibi/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/life/chibi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Page Analyzer</title>
		<link>http://www.ourlinux.net/operation-tips/web-page-analyzer/</link>
		<comments>http://www.ourlinux.net/operation-tips/web-page-analyzer/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 03:23:55 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[Softs]]></category>

		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[analyzer]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=401</guid>
		<description><![CDATA[推荐一个站点：http://www.websiteoptimization.com/services/analyze/
可以分析网页的执行效率同时会给出诸多改进的地方，不错！
感谢laurence的推荐:)

    
    
		a2a_linkname="Web Page Analyzer";
		a2a_linkurl="http://www.ourlinux.net/operation-tips/web-page-analyzer/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/web-page-analyzer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python学习摘记</title>
		<link>http://www.ourlinux.net/code/python-learn-tips-01/</link>
		<comments>http://www.ourlinux.net/code/python-learn-tips-01/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 06:29:58 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Dictionary]]></category>

		<category><![CDATA[list]]></category>

		<category><![CDATA[tuple]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=400</guid>
		<description><![CDATA[这几天在学习python，这里零星的记点，以备后用！
Python学习摘记:
3.1 Dictionary(字典)
Dictionary 是 Python 的内置数据类型之一，它定义了键和值之间一对一的关系。用{}来定义。
d={&#8221;key&#8221;:value, &#8220;key1&#8243;:&#8221;value1&#8243;}

(1) 在一个 dictionary 中不能有重复的 key。给一个存在的 key 赋值会覆盖原有的值。
(2) 在任何时候都可以加入新的 key-value 对。这种语法同修改存在的值是一样的。(是的，它可能某天会给您带来麻烦。假设你一次次地修改一个 dictionary，但其间您使用的 key 并未按照您的想法进行改变。您可能以为加入了新值，但实际上只是一次又一次地修改了同一个值。)
(3) Dictionary 的 key 是大小写敏感的
(4) 在 dictionary 中混用数据类型
Dictionary 不只是用于存储字符串。Dictionary 的值可以是任意数据类型，包括字符串、整数、对象，甚至其它的 dictionary。在单个 dictionary 里，dictionary 的值并不需要全都是同一数据类型，可以根据需要混用和匹配。
Dictionary 的 key 要严格多了，但是它们可以是字符串、整数或几种其它的类型 (后面还会谈到这一点)。也可以在一个 dictionary 中混用和匹配 key 的数据类型。
(5) Dictionary 没有元素顺序的概念。说元素 “顺序乱了” 是不正确的，它们只是序偶的简单排列。这是一个重要的特性，它会在您想要以一种特定的，可重现的顺序 (像以 key 的字母表顺序) 存取 dictionary 元素的时候骚扰您。有一些实现这些要求的方法，它们只是没有加到 dictionary 中去。
1. 修改 Dictionary
d["uid"] = &#8220;sa&#8221;
2. [...]]]></description>
		<wfw:commentRss>http://www.ourlinux.net/code/python-learn-tips-01/feed/</wfw:commentRss>
		</item>
		<item>
		<title>架设yum服务器简单笔记</title>
		<link>http://www.ourlinux.net/operation-tips/install-yum-server-tips/</link>
		<comments>http://www.ourlinux.net/operation-tips/install-yum-server-tips/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 03:03:54 +0000</pubDate>
		<dc:creator>bixuan</dc:creator>
		
		<category><![CDATA[Softs]]></category>

		<category><![CDATA[运维小技巧]]></category>

		<category><![CDATA[createrepo]]></category>

		<category><![CDATA[rhel]]></category>

		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.ourlinux.net/?p=398</guid>
		<description><![CDATA[3、4年前热衷架设yum和apt服务器，过后很久没在做过，现在都忘了，今天因为要用到，所以就做个笔记：
yum-3(印象中yum-2以前)以前是用：yum -arch /opt/rhel/rpms/ 来建立repo。
yum-3以后建立repo必须用createrepo：
rpm -Uvh createrepo-0.4.11-3.el5.noarch.rpm
createrepo -v /opt/rhel/5.2/os/
cat /etc/yum.repos.d/rhel.5.2.repo
[os]
name=Server1 Server Repository
baseurl=http://apt.ourlinux.net/rhel/5.2/os/
#baseurl=file:///opt/rhel/5.2/os/
gpgcheck=0

    
    
		a2a_linkname="架设yum服务器简单笔记";
		a2a_linkurl="http://www.ourlinux.net/operation-tips/install-yum-server-tips/";
				    
    

	]]></description>
		<wfw:commentRss>http://www.ourlinux.net/operation-tips/install-yum-server-tips/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.282 seconds -->
<!-- Cached page served by WP-Cache -->
