Useful System Tricks
You can’t debug production systems without a clever choice of tools. In this article, I’d like to talk about the ones I’ve found most useful.
In the simplest case
straceruns the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a process.
Given a process ID,
strace can tell you exactly what a process is doing at the kernel level. Think of it as a cheap tracing system. I was once able to identify deadlock merely by watching a process this way.
This is useful if you either a) don’t have distributed tracing to figure out what your application is currently doing or b) you don’t have enough logging.
A simple example with Chrome:
$ ps -eaf UID PID PPID C STIME TTY TIME CMD akshat 8174 3105 0 23:09 ? 00:00:00
Continue reading →