RE: [flalug] more memory questions...

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Mar 10 2004 - 16:16:40 EST


On Wed, 10 Mar 2004, Larry Brown wrote:

> OK, top is not really what I'm looking for because I'm wanting to script a
> process taht upon vm overload approach a script checks the pid numbers from
> the httpd access log, then calls something like ps and captures the response
> and evaluates which are the highest etc.

That's what the "-b" is for -- it does its thing then quits. Try it.

> Server sits at rest with 0 swap in use (according to free and top) Then 5
> minutes later, I have 50 to 60% swap in use.

When that happens, you can do something like

grep -h ^Vm /proc/[0-9]*/status | grep -v VmLck | sort | uniq -c | sort

and look for big numbers, or lots of smaller numbers. Once you find them,

grep '<parameter>: *<number> kB' /proc/[0-9]*/status
                  ^^^^^^^ tab, space

will give you the PID, and

ps <PID>

will give you the name.

I'm sure there's a less convoluted way to find out, but that's the first
thing that came to mind.

> I have looked at top using M to sort by memory usage and nothing seems
> excessively high.

Maybe a bunch of smaller processes? Especially statically-linked ones.
Pre-launched httpds?

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
SAGITTARIUS:  All your friends are laughing behind your back... kill
them.  Take down all those naked pictures of Ernest Borgnine you've got
hanging in your den.  -- Weird Al, _Your Horoscope for Today_



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:15:08 EDT