Le's profileSomething like a home pa...PhotosBlogListsMore Tools Help

Blog


    October 29

    龙梦改主页了

    颇有一种让人眼前一亮的感觉。

    http://lemote.com/
    October 20

    h语录

    以后搞个连载,这是第一期:
    我认为不是由于内存紧张而唤醒kswapd0进程

    评:你让人家怎么给你面子啊?我都替你愁的慌啊……
    October 19

    不能跟这帮煞笔一般见识

    草!
    你们不会懂的!
    晶!
    October 18

    wu zhangjin最近干的不错

    提交了很多龙芯的补丁。http://www.nabble.com/user/UserPosts.jtp?user=1492350

    我现在没有太多时间花在这上面,但这件事依然有人在做,看着很欣慰。

    另外,我刚刚发现layman中已经有了我的龙芯overlay。
    http://www.gentoo-cn.org/gitweb/?p=loongson.git;a=summary
    http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/overlays/layman-global.txt?r1=1.349&r2=1.350

    中国第一个被官方收录的Gentoo镜像

    http://gentoo.aditsu.net/

    http://www.gentoo.org/main/en/mirrors2.xml

    whois了一下,发现此人身居香港。

    Registrant:
       Adrian Sandor
       Private
       Tai Po,  N/A
       Hong Kong

    试了一下速度,跟飞的一样。不知道在大陆如何。

    哎,可惜中国人缺乏融入开源社区的主动性(可能和中国人含蓄内敛的民族性格有关)。
    否则这个第一,怎么会让老外拿去。

    5个避免生气的方法

    一是躲避;二是转移,人家骂你,你去下棋、钓鱼,没听见;三是释放,但要注意,人家骂你,你再去骂别人不叫释放,是找知心朋友谈谈, 释放出来,要不然搁在心里要得病的;四是升华,就是人家越说你,你越好好干;五是控制,这是最主要的一个方法,就是你怎么骂我不怕。
    October 17

    斯德哥尔摩综合症

    自有人类文明开始,有一种心理病症可能就已存在,然而直到上世纪70年代,这种病症才由于一个刑事案件受到重视,并以此得以命名,这就是斯德哥尔摩综合症(Stockholm syndrome)。

    http://www.linuxforum.net/forum/showflat.php?Cat=&Board=life&Number=733267&page=0&view=collapsed&sb=5&o=0&fpart=
    October 12

    apache performance tuning

    http://httpd.apache.org/docs/2.0/misc/perf-tuning.html

    另外原来在gentoo里,如果不指定APACHE2_MPMS,但指定了threads USE flag,那么就会启用MPM worker.
    http://httpd.apache.org/docs/2.0/mod/worker.html
    October 11

    如何查看一个listening socket的accept queue已满?

    各位已经知道的不要笑话俺。这个惊天大秘密终于被我发现了,考!

    看一看 Documentation/networking/proc_net_tcp.txt

       00000150:00000000 01:00000019 00000000
          |        |     |     |       |--> number of unrecovered RTO timeouts
          |        |     |     |----------> number of jiffies until timer expires
          |        |     |----------------> timer_active (see below)
          |        |----------------------> receive-queue
          |-------------------------------> transmit-queue

    这个receive-queue就是:sk->sk_ack_backlog

    具体的代码在:http://lxr.linux.no/#linux+v2.6.31/net/ipv4/tcp_ipv4.c#L2236

    于是我终于大概明白了为什么我的gentoo-cn.org过一段时间就会连接不上……

    且看gentoo-cn.org上现在的80端口的sk_ack_backlog大小:
    $ cat /proc/net/tcp | grep 00:0050
       5: 00000000:0050 00000000:0000 0A 00000000:00000081 02:0000000A 00000000     0        0 11883408 2 980000003eb4ad00 300 0 0 2 -1                 

    注意粗体部分:0x81,就是129!正好大于128!!!

    128是什么?128就是 /proc/sys/net/core/somaxconn, so max connections, 默认的accept q大小!!!

    所以内核就会认为acceptq满了!!!http://lxr.linux.no/#linux+v2.6.31/include/net/sock.h#L539

    所以后续连接最多只能处于SYN_RECV状态,而永远不会再有连接转成ESTABLISHED状态!!!

    不过问题还没最终解决。因为目前我不能理解的是,为什么有129这么高。而且如果说是因为没有accept(),那服务器端也没有CLOSE_WAIT状态的连接。

    啊!!!

    PS:发现apache配置中MaxClient为150,而目前有150个线程疑似处于死锁状态:
    #0  0x2acd4144 in __lll_lock_wait () from /lib/libpthread.so.0
    #1  0x2accfbb8 in pthread_cond_destroy@@GLIBC_2.3.2 () from /lib/libpthread.so.0
    #2  0x2bae081c in my_thread_end () from /usr/lib/libmysqlclient_r.so.15
    #3  0x2b5b4808 in zm_deactivate_mysql () from /usr/lib/apache2/modules/libphp5.so
    #4  0x2b6f48a8 in module_registry_cleanup () from /usr/lib/apache2/modules/libphp5.so
    #5  0x2b6ffedc in zend_hash_reverse_apply () from /usr/lib/apache2/modules/libphp5.so
    #6  0x2b6f1e60 in zend_deactivate_modules () from /usr/lib/apache2/modules/libphp5.so
    #7  0x2b693d00 in php_request_shutdown () from /usr/lib/apache2/modules/libphp5.so
    #8  0x2b78aa84 in ?? () from /usr/lib/apache2/modules/libphp5.so

    案情渐渐明朗……

    PPS: 果然,杀掉其中一个进程(含27个线程,其中有25个死锁),就可以访问了。
    我猜测apache在select()返回后,先创建线程,然后在线程中accept()。
    但是现在线程总数的限制已经达到。所以无法创建新线程来accept()。
    同时由于某目前尚未了解到的原因,原来的ESTABLISHED状态的连接也没了。

    为解决这个问题,眼下之计,要加入debug信息重新emerge apache。
    好在我有debugemerge脚本,哼哼。
    然后在下次问题再重现时,再分析为何死锁。
    不能学hw,明明缺少信息,还白耗时间在上面,硬要找出原因。

    这个活就是出卖自己的时间啊

    和其他工作仅出卖上班时间不同,这份工作是要随时准备好出卖任何一段时间段的时间。
    除非你确实因故不能打开手机。
    比如在飞机上……
    October 08

    it appears to not be an entirely attractive profession

    http://lwn.net/Articles/355416/

    最近的Real Time Linux Workshop上有个讨论,有关开发者和学术界的关系。中间提到如何鼓励学生参与社区的开发。但同时提到,如果学生根本就不想参与社区开发,那所有鼓励措施都是没用的。而且:

    As strange as it seems, it appears to not be an entirely attractive profession. It takes years of work to become a competent engineer; many are simply unwilling to put in that time. Whether things have gotten worse because people expect instant gratification now, or whether it has always been this way was a matter of debate. One panelist suggested that things will only get better when good engineers make more money than good lawyers.
    October 02

    见过大爷

    终于见过了大爷。
    拍的不错,应该再继续拍。
    把后边几年的事都拍拍。
    http://zh.wikipedia.org/wiki/%E7%BD%97%E9%9A%86%E5%9F%BA
    October 01

    明天回家

    10号回来。