1. Pstree
Pstree displaying processes in a tree structure
[Email protected]*:~# pstreeinit─┬─networkmanager ├─abrt-dump-oops ├─abrtd ├─atd ├─auditd───{ AUDITD} ├─automount───4*[{automount}] ├─certmonger ├─crond ├─dbus-daemon ├─HALD─┬─HALD-RUNNER─┬─HALD-ADDON-ACPI ││ └─hald-addon-inpu │└─{hald} ├─httpd─┬─httpd │ └─4*[httpd───26*[{httpd}]] ├─irqbalance ├─mcelog ├─6*[mingetty] ├─modem-manager ├─mysqld_safe───mysqld───38*[{mysqld}] ├─nginx───13*[nginx] ├─php-fpm───76*[php-fpm] ├─portreserve ├─rpc.idmapd ├─rpc.statd ├─rpcbind ├─rsyslogd───3*[{rsyslogd}] ├─2*[ SendMail] ├─sshd───sshd───bash───pstree ├─udevd───2*[udevd] ├─wpa_supplicant └─xinetd
2. Ps-lf
$ PS-LF 1892
As follows: The PHP process started a total of 0 threads
[Email protected]**:~# ps-lf 1892
UID PID PPID LWP C nlwp stime TTY STAT time CMD
Root 1892 1 1892 0 1 Jan15? Ss 0:53 Php-fpm:master Process (/usr/local/php/etc/php-fpm.conf)
MySQL Multiple threads:
[Email protected]*:~# ps-lf 3005
UID PID PPID LWP C nlwp stime TTY STAT time CMD
MySQL 3005 3005 0 Jan15? Sl 2:25/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3081 0 Jan15? Sl 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3082 0 Jan15? Sl 0:05/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3083 0 Jan15? Sl 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3084 0 Jan15? Sl 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3085 0 Jan15? Sl 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3086 0 Jan15? Sl 0:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
MySQL 3005 3087 0 Jan15? Sl 0:05/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/data/mysql--plugin-dir=
3. Pstack
Pstack shows the stack trace for each process, PHP's FPM master process, found that this thing is walking epoll:
[Email protected]:~# pstack 1892
#0 0x00000030e9ae8fb3 in __epoll_wait_nocancel () from/lib64/libc.so.6
#1 0x0000000000856a74 in Fpm_event_epoll_wait ()
#2 0x000000000084afff in Fpm_event_loop ()
#3 0x0000000000845ee7 in Fpm_run ()
#4 0x000000000084d900 in Main ()
You have new mail in/var/spool/mail/root
- This article is from: Linux Learning Tutorial Network
Linux under the Multi-threaded viewing tool (Pstree, PS, Pstack), the-pstree instructions for using the Linux command