What ssh command to show high load php process or high load query in apache?

I see that a the host supporter give a log like that

xxxx 10223 2.3 0.1 28176 12944 ? S 04:40 0:00 \
   | \_ /usr/bin/php /home/xxxx/public_html/index2.php
xxxx 10119 2.3 0.3 43376 25492 ? S 04:40 0:00 \
   | \_ /usr/bin/php /home/xxxx/public_html/index2.php

How to generate it?

And another question:

On server 1 I type "top" command:

 5527 xxxx  25   0 61640  42m 7488 R 96.4  0.5   3921:20 php
14713 xxxx  18   0 61636  42m 7488 R 96.4  0.5   7384:16 php
28001 997       18   0 47492  31m 7172 R 21.6  0.4   0:00.65 php
 8152 mysql     15   0  275m 143m 5336 S 19.6  1.8   4877:01 mysqld
27949 562       17   0     0    0    0 Z 15.3  0.0   0:00.46 php <defunct>

On server 2 I type "top" command and I dont see any line have "php command"

17838 apache    15   0  326m  11m 4004 S  0.6  1.2   0:00.36 httpd
18135 admin     16   0  328m  13m 2992 D  0.6  1.5   0:00.08 httpd
18153 admin     16   0  326m  11m 2528 D  0.6  1.2   0:00.03 httpd
17486 apache    16   0  306m  11m 4900 D  0.2  1.2   0:01.13 httpd
17743 admin     16   0  421m  38m  10m D  0.2  4.1   0:00.79 httpd
17983 admin     16   0  416m  48m 4476 S  0.2  5.2   0:00.49 httpd
    1 root      15   0 10356  488  460 S  0.0  0.1   0:00.06 init

Is there anything wrong on server 2?

link|improve this question
feedback

1 Answer

watch -n 1 "ps u -C apache,php"

Use that to watch the processes of PHP and Apache from a console. It will show CPU and MEM usage in live time.

link|improve this answer
i run it, but it dont show any things – dinh Dec 20 '11 at 16:12
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.