摘要: lsof 运行 top 时,按「1」打开 CPU 列表,按「shift+p」以 CPU 排序。 阅读全文
posted @ 2017-10-07 20:24 SophiaTang 阅读(185) 评论(0) 推荐(0) 编辑
摘要: strace只关心程序与系统之间产生的交互,因而strace不适用于程序逻辑代码的排错和分析。 strace的最简单的用法就是执行一个指定的命令,在指定的命令结束之后它也就退出了。在命令执行的过程中,strace会记录和解析命令进程的所有系统调用以及这个进程所接收到的所有的信号值。strace常用来 阅读全文
posted @ 2017-10-07 20:23 SophiaTang 阅读(263) 评论(0) 推荐(0) 编辑
摘要: ps: VSZ指的是进程内存空间的大小,这里是52396KB; RSS指的是驻留物理内存中的内存大小,这里是352KB。 一般系统管理员知道VSZ并不代表进程真正用到的内存,因为有些空间会仅在页表中挂个名,也就是说只是虚拟存在着,只有真正用到的时候内核才会把虚拟页面和真正的物理页面映射起来。比如,p 阅读全文
posted @ 2017-10-07 17:41 SophiaTang 阅读(830) 评论(0) 推荐(0) 编辑
摘要: http://scotdoyle.com/python-epoll-howto.htmlhttps://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/http://blog.csdn.net/sparkliang/article/d... 阅读全文
posted @ 2014-04-19 20:36 SophiaTang 阅读(158) 评论(0) 推荐(0) 编辑
摘要: http://www.jmarshall.com/easy/http/ 阅读全文
posted @ 2014-04-19 17:23 SophiaTang 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/Maximum_Segment_Lifetimehttp://blog.davidvassallo.me/2010/07/13/time_wait-and-port-reuse/http://www.sizeofvoid.net/hadoop-2-0-namenode-ha-federation-practice-zh/http://blog.csdn.net/kindy1022/article/details/7221118 阅读全文
posted @ 2013-04-14 12:21 SophiaTang 阅读(157) 评论(0) 推荐(0) 编辑
摘要: To change the location of the newly created core files, you have to change the content of /proc/sys/kernel/core_pattern:Code:sudo echo /tmp/core > /proc/sys/kernel/core_patternthis will put the core dumps in /tmp, naming them "core". You can also add some modifiers to the content of the 阅读全文
posted @ 2013-04-14 12:12 SophiaTang 阅读(640) 评论(0) 推荐(0) 编辑
摘要: Python特殊语法:filter、map、reduce、lambdaPython内置了一些非常有趣但非常有用的函数,充分体现了Python的语言魅力!filter(function, sequence):对sequence中的item依次执行function(item),将执行结果为True的item组成一个List/String/Tuple(取决于sequence的类型)返回:>>> def f(x): return x % 2 != 0 and x % 3 != 0>>> filter(f, range(2, 25))[5, 7, 11, 13, 17 阅读全文
posted @ 2012-08-16 14:12 SophiaTang 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Python中字符串处理之前介绍过了,大家一般进行字符串组合是采取下面的模式:相加:'ddd'+'sssss'结果为dddsssss或者格式化:'dddd%s%s%d' % ('-','ss',5)结果为dddd-ss5当遇到大量字符串组合而且可能数量不定的情况,这两种方式就都又点效率低了下面介绍一种比较优化的处理方法,而且可以以一定的格式组合,使用的是字符串的join方法:idlist=[]for obj in objs: idlist.append(str(obj.id))ids=','.joi 阅读全文
posted @ 2012-08-16 13:43 SophiaTang 阅读(1188) 评论(0) 推荐(1) 编辑
摘要: http://www.jsunit.net/ 阅读全文
posted @ 2012-08-05 12:59 SophiaTang 阅读(203) 评论(0) 推荐(0) 编辑