Administration

Analyze a process

Run top

top - 01:11:13 up 6 days,  1:43,  3 users,  load average: 1.96, 2.41, 2.48
Tasks: 245 total,   2 running, 243 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 97.1%id,  2.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3838996k total,  3637052k used,   201944k free,   924288k buffers
Swap:  4194296k total,    82612k used,  4111684k free,  1474944k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                              
 8047 root      20   0  895m 762m 2324 R 93.6 20.3  53:18.98 perl            

Find what’s going on:


# lsof -p 8047
COMMAND  PID USER   FD   TYPE DEVICE   SIZE/OFF     NODE NAME
perl    8047 root  cwd    DIR    8,3       4096 11191353 /home/fl/tmp/awstats
perl    8047 root  rtd    DIR    8,3       4096        2 /
perl    8047 root  txt    REG    8,3      13568 23379957 /usr/bin/perl
perl    8047 root  mem    REG    8,3     156936  6960459 /lib64/ld-2.12.so
perl    8047 root  mem    REG    8,3    1926760  6960467 /lib64/libc-2.12.so
perl    8047 root  mem    REG    8,3     145896  6960747 /lib64/libpthread-2.12.so
perl    8047 root  mem    REG    8,3      22536  6960599 /lib64/libdl-2.12.so
perl    8047 root  mem    REG    8,3      17520  6960912 /lib64/libutil-2.12.so
perl    8047 root  mem    REG    8,3     599392  7044605 /lib64/libm-2.12.so
perl    8047 root  mem    REG    8,3     113952  7044614 /lib64/libresolv-2.12.so
perl    8047 root  mem    REG    8,3     480264  6960710 /lib64/libfreebl3.so
perl    8047 root  mem    REG    8,3    1488544 23639376 /usr/lib64/perl5/CORE/libperl.so
perl    8047 root  mem    REG    8,3      43392  6960711 /lib64/libcrypt-2.12.so
perl    8047 root  mem    REG    8,3     116368  7044608 /lib64/libnsl-2.12.so
perl    8047 root  mem    REG    8,3      65928  6960428 /lib64/libnss_files-2.12.so
perl    8047 root  mem    REG    8,3      41704 23770555 /usr/lib64/perl5/auto/Encode/Encode.so
perl    8047 root  mem    REG    8,3      25624 23770786 /usr/lib64/perl5/auto/Socket/Socket.so
perl    8047 root  mem    REG    8,3   99154480 23380451 /usr/lib/locale/locale-archive
perl    8047 root    0u   CHR  136,0        0t0        3 /dev/pts/0
perl    8047 root    1u   CHR  136,0        0t0        3 /dev/pts/0
perl    8047 root    2u   CHR  136,0        0t0        3 /dev/pts/0
perl    8047 root    3r   REG    8,3      14977 23379268 /usr/local/share/perl5/Geo/IPfree.pm
perl    8047 root    4r   REG    8,3     990145 23379201 /usr/local/share/perl5/Geo/ipscountry.dat
perl    8047 root    5r   DIR    8,3       4096 11191353 /home/fl/tmp/awstats
perl    8047 root    6r   REG    8,3 5603612003  4549256 /home/fl/logs/flvoters.com-Oct-2014.log
perl    8047 root    7r   REG    8,3  119605932 11191354 /home/fl/tmp/awstats/awstats102014.tmp.8047
perl    8047 root    8w   REG    8,3    8892416 11191361 /home/fl/tmp/awstats/awstats102014.tmp.8047.bis

This is a process to re-run awstats

# /usr/bin/perl /usr/local/cpanel/3rdparty/bin/awstats.pl -config=/home/user_name/tmp/awstats/awstats.domain.com.conf -LogFile=/usr/local/apache/domlogs/domain.com -update