Nodejs os.cpu return not allowed cpu
2017-03-10 15-24-55 by KamushinThe os.cpus()
API added in Nodejs v0.3.3 shows all processors in /proc/cpuinfo
.
This API is often used to give a suggestion of how many worker processes created by cluster. However, in a docker/lxc environment, some
of the cpus are not allowed to be used by a container.
For more accurate information, we should cat /proc/self/status
. This file will show the specific allowed cpus. Or use the command nproc
.
Python subprocess 线程不安全的解决方案
2017-03-02 18-02-57
by Kamushin
1.升级至 Python3.2 2.使用多进程替代多线程 3.在 Python2.7 下使用 subprocess32 包
read more从一次失效的文件锁看看 Python 的垃圾回收机制
2017-02-17 17-54-39
by Kamushin
不同的调用方式导致了文件锁的成功与失效, 原因是触发了 Python 的垃圾回收机制. Python的垃圾回收机制还是比较原始的, 基本上就是引用计数, 标记清除和分代.没有什么黑魔法.
read moreKernelRestarter: restart failed in Jupyter
2017-02-03 17-43-26
by Kamushin
Kernel start failed in case of running Jupyter as pid 1.
read moreWhy shouldn't use component wrap a Route
2016-08-31 11-22-52
by Kamushin
研究下react-route的源码找到如何正确分离route配置的方法
read morePython subprocess包中的父子进程沟通
2016-06-02 01-19-24
by Kamushin
Python subprocess包中父子进程如何沟通, 使用不当又会有什么后果。
read morePython 调试方法
2016-05-21 15-45-00
by Kamushin
在解决一个线上程序 hang 住的过程中, 研究了几种 Python 调试方法, 总结下各自的优缺点.
read moreLoggers in Python
2016-05-21 15-14-04
by Kamushin
- Loggers will be stored in manager in Python. Handlers will cause resource leak if not removed.