Nmon crashing gathering process information

Issue #14 resolved
Matt Spiewak created an issue

We noticed that on some Linux servers the nmon process was crashing every few minutes. After our performance team did some investigation it was traced back to how its gathering process data.

It’s taking over 0.4 seconds to run the command “ps –p PID –o args” on server1, because it has a lot of processes. I ran an ltrace command on it and saw that it was gathering the information on every single process on the server, even though there is a filter of “-p PID”. I guess it’s a filter for after it gets all of the information…….

Before reporting it as a bug to Red Hat, I checked to see if they were aware of this issue, and they are, since 2014. Their solution was to create a new option ‘-q’ or ‘—quick-pid’ I cannot imagine why they created a new option of “-q” instead of fixing “-p”

https://access.redhat.com/solutions/703593

Here is a comparison between “-p” and “-q” on server1

$ time ps -p 8235 -o args COMMAND ora_vktm_rgcifdev1

real 0m0.41s user 0m0.03s sys 0m0.36s

$ time ps -q 8235 -o args COMMAND ora_vktm_rgcifdev1

real 0m0.00s user 0m0.00s sys 0m0.00s

The fix in the nmon source code should be pretty simple. I’m looking at the source code for nmon16g, this code sprintf(tmpstr, "ps -p %d -o args 2>/dev/null", pid); changed to sprintf(tmpstr, "ps -q %d -o args 2>/dev/null", pid); should fix the problem and enable nmon to be able to run the ps command to get the “args” information over 1000X faster!

Comments (3)

  1. Guilhem Marchand

    Hi,

    Thank you very much for submitting this issue, which I have to say I was absolutely unaware.

    This is a very interesting issue obviously, which touches the core of Nmon Linux source code.

    Did you have any contact yet with Nmon Linux ?

    https://sourceforge.net/projects/nmon/

    We do not maintain the source code of nmon Linux binary, though I can submit an issue on this topic.

    Guilhem

  2. Matt Spiewak reporter

    I have not had any contact with the nmon project yet. If you could submit an issue on the topic it would be greatly appreciated. Thanks.

  3. Log in to comment