上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 参考: 1、http://www.cnblogs.com/thinksasa/p/3423480.html PHP的命名空间 2、http://blog.jjonline.cn/phptech/154.html PHP中的命名空间(namespace)及其使用详解 *** 阅读全文
posted @ 2016-10-12 17:16 妞溜溜 阅读(198) 评论(0) 推荐(0) 编辑
摘要: import select import os import subprocess import time import fcntl args = ['python','./fetch_file2.py',ip,path] proc = subprocess.Popen(args, stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=... 阅读全文
posted @ 2016-08-28 13:11 妞溜溜 阅读(3517) 评论(0) 推荐(0) 编辑
摘要: python多进程代码 http://blog.csdn.net/yfkiss/article/details/6729364 Linux下多线程查看工具(pstree、ps、pstack) test.py 1、ps -ef |grep test.py 2、pstree -p 12237 3、 ps 阅读全文
posted @ 2016-08-23 14:34 妞溜溜 阅读(28174) 评论(0) 推荐(0) 编辑
摘要: 1、非阻塞设置subprocess.Popen(args, stdout=subprocess.PIPE,stderr=subprocess.PIPE) 若子进程没有执行完 直接proc.stderr.read() 阻塞,若设置成非阻塞抛出如上异常 阅读全文
posted @ 2016-08-18 17:32 妞溜溜 阅读(11535) 评论(0) 推荐(0) 编辑
摘要: 1、通过代码输出错误码以及其代表的含义 具体可以参考errno和os模块 errno.errorcode os.strerror(n) 2、有些shell命令返回码为命令自身定义 eg: man rsync 阅读全文
posted @ 2016-08-17 17:49 妞溜溜 阅读(414) 评论(0) 推荐(0) 编辑
摘要: 1、root logger以及logger斧子关系 http://www.pythonclub.org/modules/logging 输出: foo2016-08-08 17:58:09,006 - foo2016-08-08 17:58:09,006 - DEBUG - foo 2、Stream 阅读全文
posted @ 2016-08-08 10:13 妞溜溜 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1、多线程:开启一个进程test.py ,占用两个cpu 共占用45%左右(top -c ,按1) 多进程:开启两个进程test.py 用两个cpu 90%*2左右 test.py 2、多线程:开启一个进程test.py ,两个gzip进程 占用两个cpu 多进程:开启两个进程test.py ,两个 阅读全文
posted @ 2016-06-21 13:47 妞溜溜 阅读(586) 评论(0) 推荐(0) 编辑
摘要: cpu参数: 1个物理cpu,2个逻辑cpu(超线程),单核 具体 http://blog.csdn.net/dba_waterbin/article/details/8644626 物理CPU、逻辑CPU和CPU核数 打包文件,单进程 运性结果: 单进程: start:154554 end:154 阅读全文
posted @ 2016-06-17 15:59 妞溜溜 阅读(14611) 评论(0) 推荐(0) 编辑
摘要: django的orm使用方便,但对于一些复杂的操作,需要遵循特定的规范,特例特别记录一下: 模型: 1、Entry关联Blog Entry.objects.all().select_related() 对应sql:select entry.blog, ... from entry inner joi 阅读全文
posted @ 2016-06-16 16:04 妞溜溜 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 系统问题: 带宽 netstat cpu io 磁盘 内存 free vmstat命令是最常见的Linux/Unix监控工具,可以展现给定时间间隔的服务器的状态值,包括服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况 top命令 shift+m 按内存从高到低排序 iostat -xk 阅读全文
posted @ 2016-05-10 11:49 妞溜溜 阅读(287) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页