2

I'm running a Mac XServe as a dedicated apache mpm-prefork server with 8GB RAM. As part of the tuning process (I'm new to this), I'm trying to come up with the best value for MaxClients. To do so, I'm using 'top' to come up with a average process size, but I'm not sure which value represents actual memory size of the http process: 'RSIZE' or 'RPRVT'

What are the differences of these values? Thanks for any help.

Derek Downey
  • 3,955
  • 4
  • 27
  • 29

2 Answers2

2

According to:

http://macosx.com/forums/mac-os-x-system-mac-software/12720-top-command-questions.html

RSIZE = total resident memory. May be shared with other processes.

RPRVT = resident private memory.

And according to the manpage:

http://www.manpagez.com/man/1/top/osx-10.5.php

MemRegions

Number and total size of memory regions, and total size of memory regions broken into private (broken into non-library and library) and shared components.

Another interesting link:

http://lists.apple.com/archives/darwin-dev/2007/Nov/msg00132.html

dmah
  • 516
  • 3
  • 5
  • Thanks for this reply. It answered my basic question, but I'm still unsure using those values is the best way to configure MaxClients. That last link was very interesting. – Derek Downey Nov 27 '10 at 18:13
  • Some links on tuning: [ http://2bits.com/articles/tuning-the-apache-maxclients-parameter.html ] [ http://dailyvim.blogspot.com/2008/06/apache-maxclients.html ] [ http://www.nixer.org/tuning-apache-maxclients ] – dmah Nov 29 '10 at 21:23
1

dmah's answer is technically correct - but the point is that you can tell from the per-process figures shown in 'top' how much memory is being shared.

Its not the place to start when working out what MaxClients should be.

There's a complication that the system will use as much free memory as practical for I/O caching - so looking at unused memory does not give a very accurate figure either!

On Linux there's a command 'free' which reports memory usage with and without the I/O buffering/caching, but I don't know if this is available on Mac OS. I used the figures returned from this combined with the number of httpd processes to calculate what MaxClients should be (until it reaches the level where I/O caching is seriously affected, the relationship is fairly linear). But with no procfs I doubt it would be as simple as recompiling it for your machine.

IIRC on BSD in top (or systat -vmstat) it reports the buffer usage along with total memory stats at the top of the page - does MacOS?

symcbean
  • 21,009
  • 1
  • 31
  • 52
  • Yes, Mac 'top' provides that information as well. And no 'free' command unfortunately. I know MaxClients calculation is an estimate, but previously I was using an average value of RSIZE (from top output) as a per process memory usage. Even though part of that is shared (if I understand the links dmah provided), I figure it's better to overestimate than under. – Derek Downey Nov 27 '10 at 18:11