perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kjetil Kjernsmo <>
Subject Loading at startup to use shared memory
Date Mon, 06 Nov 2006 16:48:05 GMT
Hi all!

I'm working on improving the scalability and performance of our app. It 
is rather bad, and I noticed that not many minutes after restart, the 
amount of shared memory is down to 10% of the total memory (and I'm at 
least at 1/3 on my home Axkit::App::TABOO), and besides, it is bad from 
the start too.

Obviously, there is a lot to gain here, since we run a lot of children 
across many backends.

So, I pulled out Stas and Eric's book, which has a chapter about it. 
That's about mod_perl 1.0, but much of it I presume still is valid. 
Also, I found an example in
which I tried. 

I have not used the example script of Stas and Eric, but instead insert 
some GTop stuff in a registry script that loads a small picture from 
the database. It doesn't really use a lot of the stuff I load at 
startup. Then I warn the numbers, to find them in the Apache log.

Then, I have stared at the numbers with bewilderment. 

Without any file:
Size: 59346944 	Shared: 6172672 	Unshared: 53174272

Then I set the, but removed and included different modules, 
just to see what happens. The results are consistent, though:
Size: 76079104 	Shared: 5763072 	Unshared: 70316032
Size: 78835712 	Shared: 5947392 	Unshared: 72888320
Size: 73920512 	Shared: 4878336 	Unshared: 69042176

So, what I see is that consistently, the amount of shared memory goes 
down when I preload modules at server startup... Weird, huh?
It is pretty clear that total memory per child must go up by preloading 
modules, but the idea was that the shared portion of it should be much 
greater... I mean, just the code, which is identical per child, should 
contribute to this...

I've been monitoring top as the server runs too, and it seems consistent 
with these findings, also on other parts of the server. I guess we 
should rewrite a lot of stuff here, but I was hoping this would be a 
quick fix for some of our problems, as I think there is a lot in here 
that would reasonably be in shared memory pages. So, any ideas where I 
can start to understand why this isn't shared?


Kjetil Kjernsmo
Information Systems Developer
Opera Software ASA

View raw message