Processes and ps

Processes, PIDs and Useful ps Invocations

Every program runs as a process with a PID, a parent (PPID), an owner and a state, all exposed under /proc/<PID>/. Rather than ps aux, ask ps for columns with -o, a command name with -C, an order with --sort.

Apache's and PHP-FPM's process familiesShell
ps -C apache2 -o pid,ppid,user,stat,rss,etime,cmd
pgrep -a php-fpm                  # matching PIDs with their command lines
Output
    PID    PPID USER     STAT   RSS     ELAPSED CMD
    178       1 root     Ss   43076       16:16 /usr/sbin/apache2 -k start -DFOREGROUND
   8370     178 www-data S    18400       08:10 /usr/sbin/apache2 -k start -DFOREGROUND
...
221 php-fpm: master process (/etc/php/8.5/fpm/php-fpm.conf)
416 php-fpm: pool www

A root master (PPID 1: systemd 142,543 started it) holds the port and configuration; www-data workers do the work. Kill a worker and the master replaces it; kill the master and the site is down. RSS is resident memory in KiB. In STAT, R is running, S sleeping, D stuck in disk I/O, Z a zombie not yet reaped and T stopped. --sort=-rss finds what is big, but %CPU in ps is a lifetime average: for "right now", use top or htop 386,022 .