Skip to content

Instantly share code, notes, and snippets.

@jsl
Created February 9, 2013 11:08
Show Gist options
  • Save jsl/4744886 to your computer and use it in GitHub Desktop.
Save jsl/4744886 to your computer and use it in GitHub Desktop.
Figuring out what resque processes are doing
In the resque web interface, if you see a process that is hanging for a long
time, you can figure out what it's waiting on by looking at the PID. Say
we see pid 4894 taking a long time. In the console do:
$ sudo strace -p 4894
Process 4894 attached - interrupt to quit
wait4(15045,
The strace just hangs there, and we think that perhaps the process isn't
doing anything. If you look at the man page for wait4, you see that the
first argument is a PID. wait4 is just waiting for the return of the
process 15045.
There are lots of things you can use to see what a PID is doing. strace
show system calls, ltrace shows library calls. lsof will show open
files. Of course there is always top to see what a process is doing
at the moment. In this case I can easily see that process 15045 is
legitimately busy and not hung.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment