4

Does anyone know of a way to monitor the load & resource usage of a single program. What I have is a process I'd like to know how much load it puts on the server but it's not something I can just "monitor" to get a feel for.

What I'd like to do is something like

$ monitor "someapp" &

and let it run, then review some sort of log. Is there any Red Hat package or downloadable program that can more or less monitor an entire processes load & resource usages??

2 Answers 2

1

SystemTap is what you are looking for. It won't be easy (but it won't be too hard either) but it will pay off.

SystemTap is the RH designated & supported tool for this type of data gathering. The rpm package name is systemtap. It's similar to Solaris' Dtrace.

And, no, it is not a vague question. But ... yes, looking at only the behavior of one process and ignoring the rest of the system might give you a vague answer.

1

The problem is that your request is not well defined. You say you want to monitor 'how much load it puts on the server', but that's not a single thing. Programs can cause i/o load, cpu load, network load, memory 'load' (ie. run out of memory), even interrupt load (if they interact with hardware), but all those things are then aggregated for efficiency by the kernel.

For instance, if your process uses a shared library that another program is using, which program does it count against? What if it uses a shared lib that isn't currently being used (and is therefore not loaded)? If two processes simultaneously request to load a shared library, which one does the disk i/o get charged against? What if those disk blocks were in readahead cache because a completely unrelated process happened to read a file that was 'nearby' on-disk ? An OS is an operating system... as such, it evinces complex interactions that don't necessarily allow individual parts to be analyzed separately.

Some things that will give you good info:

  • top will of course show you a ranked list based on some metrics, though read the manpage carefully for how things like memory accounting is done.

  • /proc/ is a kernel-mediated view of your process, including what filehandles it has open, what memory it's got mapped, all kinds of things. See the manpage for detailed info.

  • strace will trace the system calls a program makes so you can tell, to an extent at least, what it's doing. Again, the manpage has detailed info.

4
  • I thought "Load and Resource Usage" is pretty well defined. You reiterate it in your reply. CPU, Network, etc. I'm trying to get an idea of what a single process will use as far as resources. If no tool exists for this I can understand that. I thought about using process accounting, but don't want to enable it "system wide". I want to basically run a "Top","iftop" and "iostat" of a process. Which more or less rolls up to everything.
    – Mech
    Jul 13, 2010 at 21:41
  • No it is not well defined. Also many of the important metrics (disk and network I/O being obvious cases) are not easily measured on per process basis. On a POSIX system "load" has a very specific meaning - i.e. the length of the run-queue which is meaningless for a single process.
    – symcbean
    Jul 14, 2010 at 12:07
  • I mentioned Red Hat not posix. In either case there is either a tool that does something close to this or there is not. Based on the lack of responses I'm going to guess that no such tool exists or comes close to monitoring a single process from the command line and outputting it's utilization on system resources.
    – Mech
    Jul 14, 2010 at 19:50
  • I'm voting this back up since it's a valid response to a rather vague question. You need to learn what POSIX is in relation to redhat and operating systems in general. Jul 15, 2010 at 18:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .