OS: Process: Runtime Information

 20th August 2020 at 2:19pm

/proc/<pid> 目录存放了进程运行时的信息。/proc/<pid>/comm 放的是当时运行进程的命令,比如 python, httpd, gunicorn 等。但是它有 16 个字节(定义在 TASK_COMM_LEN)的长度限制,超过了会被截断。

nginx, postgres 会修改 proc title,变成类似 nginx: master 这样。Python 的 setproctitle 包也提供了类似的能力。