Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way in linux to send a signal or otherwise install an handler to be called when a process surpasses a given rate of hard page faults per second?

A simple sigstop would avoid many accidental crashes I had (swap death), but I imagine there may be false positives if, say, the process uses memory mapped files.

share|improve this question

To check for processes with a high rate of page faults per second:

pidstat -r

The interesting column is majflt/s ( Total number of major faults the task has made per second, those which have required loading a memory page from disk ). From there it is up to you to decide what to do with the processes or filter the ones that can be safely stopped.

share|improve this answer
Yeah, I know how to get that information: it's all in /proc/pid/stat; my goal was more to avoid polling every pid every second and to register a callback at the kernel level. Something like /proc/sys/kernel/core_pattern that lets you specify a program to handle core dumps. Or maybe something easily hacked up with kprobes. (But I didn't know that particular tool, so thank you.) – foober May 6 '11 at 10:23

Your Answer


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.