The 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 more

KernelRestarter: restart failed in Jupyter

2017-02-03 17-43-26 by Kamushin

Kernel start failed in case of running Jupyter as pid 1.

read more

2017-01-16 15-42-57 by Kamushin

No space left on device

2017-01-05 13-40-12 by Kamushin

No space left on device

read more

2017做点啥

2017-01-04 23-41-55 by Kamushin

done is better than perfect.

read more

2016年度总结旅游篇

2016-12-18 11-57-14 by Kamushin

浙江南浔-浙江仙居-越南岘港-浙江东极岛-西北青海大环线-泰国清迈-?

read more

最近在做的事情

2016-12-16 18-16-03 by Kamushin

几个月没写博客了, 总结下最近做的事情

read more

Docker容器管理

2016-09-28 11-38-53 by Kamushin

这段时间会尝试多种容器管理方式。

read more