开发 Tips(5)
主要记录最近遇到的一些开发问题,解决方法。
1. Python 内存分析方法
主要涉及四个工具:- memory_profile:分析每一行代码的内存使用量
- objgraph:跟踪内存中的对象的关系
- guppy:在运行时跟踪堆的使用情况
- pyrasite:向进程中注入代码
- 根据上一步的信息定位到代码中的某一块,再使用 memory_profile 或 objgraph 来进行进一步的分析
- 创建 my-vm-name 虚拟机
- 查看全部 docker-machine
- 登录到 docker-machine
- 获取 docke-machine 的宿主机 IP
- 其他命令
- 启动容器,映射端口格式: hostPort:containerPort
- 以 shell 的形式登录到容器
- 查看容器的日志
2. Docker Machine 基本操作命令
|
|
|
|
|
|
|
|
|
|
|
|
3. 在 Docker Machine 安装软件
|
|
|
|
|
|