Question about 'top' values on memory usage

Clifton Royston cliftonr at lava.net
Mon Oct 15 18:13:18 PDT 2007


On Mon, Oct 15, 2007 at 03:08:36PM -0700, Alfred Perlstein wrote:
> * William LeFebvre <bill at lefebvre.org> [071015 06:49] wrote:
> > 
> > Unfortunately, freebsd does not appear to track the amount of shared 
> > virtual memory for each process.  It could be obtained by walking 
> > through all the pages in a process's vm map, but that would really slow 
> > top down.  I don't know of any freebsd utility that would give that 
> > information for an individual process.  But hey, if it's out there 
> > somewhere where it is easy to grab, I would be very happy to add it to top.
> 
> Or this could be properly accounted for when the map is updated?
> 
> > Personally, based on my experience, I would be more concerned with the 
> > amount of available cpu cycles than memory.  In my experience, once you 
> > run out of idle time on a web server you have exceeded its capacity to 
> > serve pages.  In that situation it doesn't matter how many httpd 
> > processes there are, the system is still not able to keep up with 
> > demand.  And that will probably happen before the system starts 
> > thrashing from limited memory.
> 
> Bill, I would have to differ with you based on personal experience,
> I've almost never run out of cpu on a webserver, typically it's the
> RAM that gets blown out.   Once the server starts to page, you typically
> wind up with a cascade failure and the box just goes ... belly up.

  IME, it really depends mostly what kind of content you're serving;
I've seen either one, or disk, be the problem.  Serving mostly static
pages?  Don't worry about CPU, it'll be the RAM.  Naive database
search, not caching the results?  You may get killed on disk I/O.  If
you're serving some kind of computationally "expensive" content via a
CGI and the site gets hit, then it'll run out of CPU.

  All in all I would guess the latter's much rarer, assuming you're
using a well configured webserver built with an appropriate
client-connection service model.  OTOH, if you can guess the process
limits correctly, you can usually set them with a safety margin such
that the machine won't hit the number of processes to force it into
paging; it'll be unresponsive to clients above its limit, but continue
to respond adequately to the clients which succeed in connecting.
All IMHO.
  -- Clifton

-- 
    Clifton Royston  --  cliftonr at iandicomputing.com / cliftonr at lava.net
       President  - I and I Computing * http://www.iandicomputing.com/
 Custom programming, network design, systems and network consulting services


More information about the freebsd-stable mailing list