<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[wuchunlai_2012的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/wuchunlai_2012</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; wuchunlai_2012]]></copyright><item><title><![CDATA[Openresty测试框架--Test::Nginx]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/100059067</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/100059067</guid><author>wuchunlai_2012</author><pubDate>Sun, 25 Aug 2019 00:40:01 +0800</pubDate><description><![CDATA[Test::Nginx使用说明
1. 简介
1.1 组件介绍
Test::Nginx是一个由Perl编写的nginx测试组件，继承自Test::Base。
1.2 安装方法
sudo cpan Test::Nginx

1.3 测试目录结构
测试目录最好命名为t，因为在测试过程中会在t中创建conf目录存储当前测试的配置和日志（默认路径为t/），应该可以提供参数来指定目录，尚未研究。
cc_cac...]]></description><category></category></item><item><title><![CDATA[Linux命令 --- date]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/78043993</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/78043993</guid><author>wuchunlai_2012</author><pubDate>Wed, 20 Sep 2017 18:31:13 +0800</pubDate><description><![CDATA[date [OPTION]… [+FORMAT] 参数 
-d –date= 
格式化输出指定的时间，可以使用’20170601 11:11:11’的方式来作为参数，可以省去部分做简写 
可以使用以下缩写:now, yesterday, last-day, tomorrow, next-day, next-month 
                           ‘30 days ago’]]></description><category></category></item><item><title><![CDATA[Linux命令 --- ps/pstack/pstree]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/78043361</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/78043361</guid><author>wuchunlai_2012</author><pubDate>Wed, 20 Sep 2017 17:31:38 +0800</pubDate><description><![CDATA[pstack 
pstack   pid 
显示某个进程的栈跟踪，必须在对应的用户组或root下操作。[wuchunlai@s1 ~]$ sudo -u work pstack $(pgrep cc_engine)
Thread 3 (Thread 0x7fb3467ff700 (LWP 6130)):
#0  0x000000370cae5d03 in epoll_wait () from /li]]></description><category></category></item><item><title><![CDATA[【犯二记录】链表结点换位引发的思维僵化，太可怕，智商 == 0]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/53165912</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/53165912</guid><author>wuchunlai_2012</author><pubDate>Mon, 14 Nov 2016 22:38:34 +0800</pubDate><description><![CDATA[今天由于业务需要，把之前写的链表结构改造成了双向链表，并添加了一些功能上去，在这其中某个功能需要对链表在插入时进行排序。
为什么是插入的时候排序不是最后再排序呢，不是多次一举吗？其实这是根据我们的业务需求决定的，在这里数据某段时间内是集中在几个key上的，但是数据量又非常大，所以就很直接的选择了最简单的双向链表在每次插入的时候重新定位，其实类似于堆排序中的上升，每次找到需要改变的结点进行操作后，调用]]></description><category></category></item><item><title><![CDATA[Linux下各压缩方式测试（压缩率和使用时间）]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/52598870</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/52598870</guid><author>wuchunlai_2012</author><pubDate>Tue, 20 Sep 2016 18:50:52 +0800</pubDate><description><![CDATA[压缩比及压缩速度测试:$ head -n 2000 cc_detail_201608.sql > 1$ time tar -c –lzma -f 1.glz 1 
real    23m44.216s$ time tar -c –xz -f 1.gxz 1 
real    25m26.296s$ time tar -czf 1.tgz 1 
real    1m17.476s$ time tar]]></description><category></category></item><item><title><![CDATA[Linux命令 --- 查找筛选grep]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/52588341</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/52588341</guid><author>wuchunlai_2012</author><pubDate>Mon, 19 Sep 2016 18:51:15 +0800</pubDate><description><![CDATA[Linux系统中grep命令是一种强大的文本搜索工具，它能使用正则表达式搜索文本，并把匹配的行打印出来。grep全称是Global Regular Expression Print，表示全局正则表达式版本，它的使用权限是所有用户。grep可用于shell脚本，因为grep通过返回一个状态值来说明搜索的状态，如果模板搜索成功，则返回0，如果搜索不成功，则返回1，如果搜索的文件不存在，则返回2。我们利用]]></description><category></category></item><item><title><![CDATA[Linux命令 --- 文件比较diff/cmp]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/52402239</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/52402239</guid><author>wuchunlai_2012</author><pubDate>Thu, 01 Sep 2016 17:58:35 +0800</pubDate><description><![CDATA[diff [options] 源文件 目标文件 
按行比较两个文件，并显示两者的区别。 
-i 忽略大小写 
-b 不检查空格字符的不同 
-B 不检查空白行 
-c 显示文件全文并对不同进行标注 
-w 忽略所有的空格 
-p 当比较的是c代码时显示所在的函数 
-q 仅显示有无差异 
-r 比较子目录的文件 
-T 在每行前面加tab以保持对齐 
-y 以并列的方式显示两个文件的不同（-W指定宽]]></description><category></category></item><item><title><![CDATA[Linux命令 --- 文件操作篇]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/52281705</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/52281705</guid><author>wuchunlai_2012</author><pubDate>Mon, 22 Aug 2016 23:43:00 +0800</pubDate><description><![CDATA[mkdir
mv
cp
touch
chmod
ls
cd
rm
9.]]></description><category></category></item><item><title><![CDATA[Linux命令 --- 登入登出篇]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/52161479</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/52161479</guid><author>wuchunlai_2012</author><pubDate>Tue, 09 Aug 2016 11:54:39 +0800</pubDate><description><![CDATA[login  [name][-p ][-h 主机名称] 
在命令行系统里登录某个用户进行工作。 
-p保持当前的环境参数 
-h远程登录
logout 
与login相对，用户进行注销工作。 
（ctrl+d可以作为快捷键）
shutdown [OPTION]… TIME [MESSAGE] 
-r关机后重启 
-h/H/P关机后待机或断电源 
-c取消一个关机的指令（从pid删除），可以加解释说明]]></description><category></category></item><item><title><![CDATA[总结一下自己常用的linux命令（实战or面试必备）]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50947515</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50947515</guid><author>wuchunlai_2012</author><pubDate>Mon, 21 Mar 2016 16:19:06 +0800</pubDate><description><![CDATA[shutdown
shutdown [-h][-i][-k][-m][-t]
shutdown -time 30      // 30分钟后关机
shutdown -h -time 30   // 关机后关掉电源（彻底关机）
shutdown -h now        // 立即关机并关闭电源    halt命令
shutdown -k            // 给其他用户发送关机预警
2.]]></description><category></category></item><item><title><![CDATA[nginx源码初读（12）--跟main一起看流程（Block 1: 初始化基础模块 Block 2：获取参数）]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50856051</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50856051</guid><author>wuchunlai_2012</author><pubDate>Fri, 11 Mar 2016 14:48:30 +0800</pubDate><description><![CDATA[在这一节终于可以开始看流程看机制了，还是小激动的，毕竟只看数据结构还是不懂。因为数据结构+算法+代码才能完整的理解nginx啊。前面11节我们总结了所有可能用到的基本数据结构，至于每个结构相应的方法，出了str其他没有过多讲述，后面看流程的时候遇到都会进行研究。我就直接分阶段贴代码了，一段一段慢慢的看。有一些内容对理解没什么用就直接…了，见谅。Block 1: 获取参数 
—->>函数启动：main]]></description><category></category></item><item><title><![CDATA[nginx源码初读（11）--让烦恼从数据结构开始(ngx_command/ngx_module/ngx_conf)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50847153</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50847153</guid><author>wuchunlai_2012</author><pubDate>Thu, 10 Mar 2016 15:24:31 +0800</pubDate><description><![CDATA[第一点：ngx_command_t 
ngx_core_commands是nginx中的核心模块指令， 它的类型就是ngx_command_t。在每一个module的结构体中，也都有一个ngx_command_t。typedef struct ngx_command_s     ngx_command_t;struct ngx_command_s {
    ngx_str_t]]></description><category></category></item><item><title><![CDATA[nginx源码初读（10）--让烦恼从数据结构开始(ngx_cycle)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50803271</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50803271</guid><author>wuchunlai_2012</author><pubDate>Fri, 04 Mar 2016 15:47:35 +0800</pubDate><description><![CDATA[Nginx框架是围绕着ngx_cycle_t结构体来控制进程运行的。ngx_cycle_t结构体的prefix、conf_prefix、conf_file等字符串类型成员保存着Nginx配置文件的路径。Nginx在程序运行的时候会使用ngx_init_cycle方法来根据nginx.conf加载模块。ngx_cycle_t结构体定义：struct ngx_cycle_s {
    void]]></description><category></category></item><item><title><![CDATA[nginx源码初读（9）--让烦恼从数据结构开始(ngx_listening/ngx_connection)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50732741</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50732741</guid><author>wuchunlai_2012</author><pubDate>Wed, 24 Feb 2016 18:20:46 +0800</pubDate><description><![CDATA[在nginx中connection就是对tcp连接的封装，其中包括连接的socket，读事件，写事件。利用nginx封装的connection，我们可以很方便的使用nginx来处理与连接相关的事情，比如，建立连接，发送与接受数据等。而nginx中的http请求的处理就是建立在connection之上的，所以nginx不仅可以作为一个web服务器，也可以作为邮件服务器。当然，利用nginx提供的con]]></description><category></category></item><item><title><![CDATA[nginx源码初读（8）--让烦恼从数据结构开始(ngx_event)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50731037</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50731037</guid><author>wuchunlai_2012</author><pubDate>Wed, 24 Feb 2016 15:11:34 +0800</pubDate><description><![CDATA[nginx中的事件模块是一个很重要的模块，但这里作为初读，我们只简单看一下ngx_event的数据结构，至于模块和机制，留作之后再分析。下面是结构体ngx_event_t的代码：typedef struct ngx_event_s    ngx_event_t;
struct ngx_event_s {
    void            *data;
    /* 事件上下文数据，通常data]]></description><category></category></item><item><title><![CDATA[nginx源码初读（7）--让烦恼从数据结构开始(ngx_queue)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50725537</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50725537</guid><author>wuchunlai_2012</author><pubDate>Tue, 23 Feb 2016 19:17:46 +0800</pubDate><description><![CDATA[ngx_queue_t是nginx中的双向链表，我们看看它的数据结构，太简单：typedef struct ngx_queue_s ngx_queue_t;
struct ngx_queue_s {
    ngx_queue_t  *prev;
    ngx_queue_t  *next;
};是不是很简单？学过数据结构的我们一看就懂了。唉？等一下！等一下！等一下~~我老公呢~等一下。。（乱入，]]></description><category></category></item><item><title><![CDATA[nginx源码初读（6）--让烦恼从数据结构开始(ngx_list)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50724880</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50724880</guid><author>wuchunlai_2012</author><pubDate>Tue, 23 Feb 2016 17:43:28 +0800</pubDate><description><![CDATA[nginx自定的list跟我们常见的list是不太一样的，不同点就在于它的节点，它的节点不像我们常见的list的节点，只能存放一个元素，ngx_list_t的节点实际上是一个固定大小的数组。在初始化的时候，我们需要设定元素需要占用的空间大小，每个节点数组的容量大小。在添加元素到这个list里面的时候，会在最尾部的节点里的数组上添加元素，如果这个节点的数组存满了，再增加新的节点。我们看一下数据结构定义]]></description><category></category></item><item><title><![CDATA[nginx源码初读（5）--让烦恼从数据结构开始(ngx_array)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50724271</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50724271</guid><author>wuchunlai_2012</author><pubDate>Tue, 23 Feb 2016 16:41:42 +0800</pubDate><description><![CDATA[数组的结构体定义：typedef struct ngx_array_s       ngx_array_t;
struct ngx_array_s {
    void        *elts;           // 指向数组存储位置的首地址
    ngx_uint_t   nelts;          // 当前数组中已经存放的元素个数
    size_t       size;]]></description><category></category></item><item><title><![CDATA[nginx源码初读（4）--让烦恼从数据结构开始(ngx_str)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50717913</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50717913</guid><author>wuchunlai_2012</author><pubDate>Mon, 22 Feb 2016 16:59:58 +0800</pubDate><description><![CDATA[nginx作者定义的ngx_str_t中，字符串并不是以传统c的’\0’结尾的，使用了长度len配合data来表示一个数据段。所以我们要尽量使用nginx自带的api进行操作，如果没有自带，那就自己写一个api来进行相关操作，而不要随便使用c自带的字符串处理函数，那样很可能会导致内存越界，而且从原则上来说，这是违规行为。看看ngx_str_t被定义成了什么：typedef struct {]]></description><category></category></item><item><title><![CDATA[nginx源码初读（3）--让烦恼从数据结构开始(ngx_pool)]]></title><link>https://blog.csdn.net/wuchunlai_2012/article/details/50715966</link><guid>https://blog.csdn.net/wuchunlai_2012/article/details/50715966</guid><author>wuchunlai_2012</author><pubDate>Mon, 22 Feb 2016 12:26:49 +0800</pubDate><description><![CDATA[nginx_pool提供了一种资源管理机制（如内存，文件等），使得对资源的使用和释放统一进行，免除了资源释放的很多问题，开发者只需在需要内存时进行申请即可，不用过多考虑内存的释放等问题，大大提高了开发的效率。例如，在特定的生命周期统一建立内存池(如main函数系统启动初期即分配1024B大小的内存池)，需要内存时统一分配内存池中的内存，在适当的时候释放内存池的内存(如关闭http链接时调用ngx_d]]></description><category></category></item></channel></rss>