Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a Debian webhosting machine with cpu loads around 11. Using top I see that perl is using 99% of the cpu as user www-data. How can I find out more about what perl is actually doing?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

strace -p PID

... where PID is the process ID should give you some information. You'll want to google for some simple articles on using it if you've never used it before, though. Depends on how familiar you are with system calls to interpret the information. You'll want to look at the manpage or articles to log it to a text file as the output may be very fast and dump a lot of information very quickly, and there are a number of options to use.

share|improve this answer
    
I tried that earlier (google's idea, I am not familiar w strace) and the results were a long list of: select(752, [748], NULL, NULL, {0, 0}) = 0 (Timeout) so I thought I might have misunderstood what strace did. But thanks, I'll dig deeper. –  kswift Jan 12 '12 at 20:28
    
@kswift select() is a function to wait for a file descriptor (possibly a file or a socket) to become ready for an operation - in this case a read operation (see man 3 select for details. The descriptor ID is process-specific, just run readlink /proc/<pid>/fd/748 to see what it is. –  the-wabbit Jan 13 '12 at 15:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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