Process Resource Monitor

Current Release:
http://www.rfxn.com/downloads/prm-current.tar.gz
http://www.rfxn.com/appdocs/README.prm
http://www.rfxn.com/appdocs/CHANGELOG.prm

Description:
Process Resource Monitor (PRM) is a CPU, Memory, Processes & Run (Elapsed) Time resource monitor for Linux & BSD. The flexibility of PRM is achieved through global scoped resource limits or rule-based per-process / per-user limits. A great deal of control of PRM is maintained through a number of ignore options, ability to configure soft/hard kill triggers, wait/recheck timings and to send kill signals to parent/children process trees. Additionally, the status output is very verbose by default with support for sending log data through syslog.

There is no shortage of usage methods for PRM, especially when leveraging the ignore and kill options with the rule based system. You can easily take control of those run-away aspell/pspell processes eating 80% of memory, errant exim processes threading off 500 processes or prevent scripts executed under apache from running for hours at a time.

Features:
– global resource limits
– per-process/per-user rule based resource limits
– rules only run mode
– alert only run mode
– ignore root processes option
– process list global ignore file
– user based global ignore file
– command based global ignore file
– regex based global and/or per-rule ignore variable
– global scoped resource limits
– per-process or per user rule based resource limits
– set custom kill signals (i.e: SIGHUP)
– parent process kill option to terminate an entire process tree
– kill trigger/wait times allow rechecking usage over a period of time
– kill restart option to execute a custom restart command
– all kill/resource/ignore options can be global or rule defined
– easy to configure percentage of total CPU & MEM limits
– total number of processes limits
– elapsed run time limits

Funding:
Funding for the continued development and research into this and other projects, is solely dependent on public contributions and donations. If this is your first time using this software we ask that you evaluate it and consider a small donation; for those who frequent and are continued users of this and other projects we also ask that you make an occasional small donation to help ensure the future of our public projects.

47 Replies to “Process Resource Monitor”

  1. The file: http://www.rfxn.com/downloads/prm-current.tar.gz should extract as prm-1.0.6. What version are you seeing when you download? Also make sure you have no older copies of prm-current.tar.gz in the folder you are downloading too an accidentally extracting it instead.

    A direct link to the latest version is at:
    http://www.rfxn.com/downloads/prm-1.0.6.tar.gz


    Chuck:

    Hi Ryan,

    I’m a little confused at where to get the new tarball. If I click current I still get the old version. Can’t wait to try the new script.

    Chuck

  2. Hi Ryan,

    I’m a little confused at where to get the new tarball. If I click current I still get the old version. Can’t wait to try the new script.

    Chuck

  3. Yup, exactly that, please be sure to check the README file for some usage examples under section 4.


    Son Nguyen:

    Thanks for all your works Ryan! For the new PRM, is upgrading is just as simple as install the new package and it will overwrite the old files?

  4. If prm doesnt use, $6, then just replacing cmd with comm will fix the issue:

    [[email protected] prm]# ps -A -o “user pid pcpu pmem comm” | grep bash
    root 12654 0.0 0.2 bash


    Vincent:

    Hi Ryan,
    In my server the ps -A command returns the following line:
    root 8848 0.0 0.2 -bash
    making $5 “-bash” and returning the error:
    ====
    Usage: grep [OPTION]… PATTERN [FILE]…
    Try `grep –help’ for more information.
    ====
    I did a quick fix by changing line 134 from:
    cmd=”$5″
    to
    cmd=”$(echo $5 | sed ’s/\b\-//’)”
    Hope this helps improve your script.
    Thanks much.
    Vincent

  5. Hi Ryan,

    In my server the ps -A command returns the following line:
    root 8848 0.0 0.2 -bash
    making $5 “-bash” and returning the error:
    ====
    Usage: grep [OPTION]… PATTERN [FILE]…
    Try `grep –help’ for more information.
    ====
    I did a quick fix by changing line 134 from:
    cmd=”$5″
    to
    cmd=”$(echo $5 | sed ‘s/\b\-//’)”

    Hope this helps improve your script.

    Thanks much.
    Vincent

  6. At the moment, PRM has no alert-only feature but I am in the process of rewritting PRM as we speak and will add it to the feature list. It should be out sometime in the next day or so, as it not really a complex project to rework.

  7. If I prefer to limit resources for some users and monitor only resources for other is this possible and would it fall under rules rather than the prm.conf or would changes be required for both.

    what I was thinking of is the exim rule in general. on most accounts I would only want to monitor, then if I found misuse would prefer to kill as well but only on abusive accounts.

    TIA

  8. When PRM finds a process that has exceeded resources, it will wait the amount of time defined by WAIT=”” before rechecking the process and finally kill the process after KILL_TRIG=”” number of times.

    So the default config tells PRM to recheck a process 3 times with 12 seconds between each check

    The LC value simply tells PRM which load value to look at, Linux has a 1, 5 and 15 minute load average and that is represented by LC with 1,2,3 values for the respective load value.

    I know PRM is a little counter intuitive on some of it options and it is due for a complete rewrite but it does work and at the end of the day thats what counts.

  9. Does WAIT=”12″ depend on cronjob? What does LC used for (do I need to run cronjob every 5 minutes even I have set LC=”1″)?

Leave a Reply

Your email address will not be published. Required fields are marked *