On Aug 24, 2006, at 6:00 AM, Philip M. Gollucci wrote:

> Based on GTOP metrics above, you need to test the copy-on-write of
> FreeBSD..
> The A::SL docs have a method to do this contributed by Torsten
> Forsch(sorry if I spelled your name wrong)
> You might e-mail questions@freebsd.org or current@freebsd.org as
> they will be much more authoritative then me.


Does anyone have a link for this? I can't seem to find it in the
reelased docs or in svn trunk. i probably stared at it, and just
missed it.

From the profling I've been able to do by monitoring free mem vs
swap mem via top, i've *think* that I've the following out

The parent process is ~ 45 MB
Each child launches with ~2.4 MB of private memory
A single request consumes about 2.4 MB of memory
Based on other page request numbers, i think:
1.5mb is from page dispatch / session handling / context object
setup / general templating routines
1mb is from the page content generation
Many requests to alternate pages will consume 1mb of additional
memory-- though many will consume no additional memory. This seems
to happen regardless of the amount of / complexity of logic on the
page. So i'm at a loss on that.

multiple requests to the same page ( object ) don't seem to grow
unshared size that much.

i'm going to guess that the bulk of growth in those terms comes from
DBI ( i learned that DBI caches statement handles internally, but
resets itself every 120 prepares . so it looks like you leak 4+k
every time you hit the db, but should stop after 120 (each child) ).
i need to play with maxrequestsperchild and ab to confirm that is the
case.

i seem to be running ~1mb per page in growth though, which i find
odd. i'll have to profile my code better and see how its growing
that much for 4k of html generation. now that i've got a 2nd hard
drive running ubuntu next to me, that should make things better.

i tried the test a few times, with similar results ( although i
seemed to have lost 4mb of memory on two of the stop/starts , which
makes no sense to me, and i didnt see any other processes pop up)

in any event, prefork seems to be sharing on freebsd, but there's no
real way to telling so unless you watch memory and run some manual
tests.

----------

numbers are free mb

Launch 1 child

234 > 187

1 request (page a)
187 > 185

10 requests (page a)
185 > 184

20 requests (page a)
185 > 183

40 requests (page a)
185 > 182

1 request ( page b )
182 > 181

10 request ( page b )
182 > 180

20 request ( page b )
182 = 182

40 request ( page b )
182 = 179

Stop
231 Free

=========

Launch 6 children
231 > 172

1 request ( page a )
172 > 170

10 requests ( page a )
170 > 157

20 requests ( page a )
157 = 157

100 requests ( page a )
157 > 156

1 request ( page b )
156 = 156

10 request ( page b )
156 > 155

20 request ( page b )
155 > 155

100 request ( page b )
155 > 153

Stop
227 Free