PSコマンドで、Nginx/UnicornのWorkerプロセスを見る


PSコマンドの、-ef --forestオプションを付与する

nginx

ec2-user 32110 32086  0 09:59 pts/0    00:00:00              \_ grep nginx
root      3011     1  0 Apr28 ?        00:00:00 nginx: master process /usr/sbin/nginx
nginx     3012  3011  0 Apr28 ?        00:00:25  \_ nginx: worker process

unicorn

[ec2-user@ip-10-0-0-69 ~]$ ps -ef --forest | grep unicorn
ec2-user 32119 32086  0 09:59 pts/0    00:00:00              \_ grep unicorn
root      1980     1  0 Jun05 ?        00:00:10 unicorn_rails master -p 3000 -E production -c config/unicorn.rb -o localhost                                              
root      2013  1980  0 Jun05 ?        00:00:04  \_ unicorn_rails worker[0] -p 3000 -E production -c config/unicorn.rb -o localhost                                           
root      2016  1980  0 Jun05 ?        00:00:04  \_ unicorn_rails worker[1] -p 3000 -E production -c config/unicorn.rb -o localhost                                           
root      2018  1980  0 Jun05 ?        00:00:06  \_ unicorn_rails worker[2] -p 3000 -E production -c config/unicorn.rb -o localhost                                           

参考

Inside NGINX: How We Designed for Performance & Scale