On Wed, Aug 4, 2010 at 8:25 AM, Philip M. Gollucci <pgollu...@p6m7g8.com>
wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
http://people.apache.org/~pgollucci/Apache-SizeLimit-0.92-rc1.tar.gz
http://people.apache.org/~pgollucci/Apache-SizeLimit-0.92-rc1.tar.gz.md5
http://people.apache.org/~pgollucci/Apache-SizeLimit-0.92-rc1.tar.gz.sha256
http://people.apache.org/~pgollucci/Apache-SizeLimit-0.92-rc1.tar.gz.asc
Builds and tests fine both on Debian Lenny w/ Apache 2.2.9
and perl 5.10 and Ubuntu 10.04.
I seem to understand that our current SizeLimit config (below) will
be completely bogus with the new version, right?
<Perl>
use Apache2::SizeLimit;
# Will prevent murders of immature children that just needs to grow a bit
$Apache2::SizeLimit::CHECK_EVERY_N_REQUESTS = 30;
$Apache2::SizeLimit::MAX_PROCESS_SIZE = 470_000;
$Apache2::SizeLimit::MIN_SHARE_SIZE = 50_000;
open(DATA,"</proc/meminfo");
my ($mem) = <DATA> =~ m/MemTotal:\s+(\d+)/;
close(DATA);
# See Practical mod_perl page 352
#
int(($mem-1000000-$Apache2::SizeLimit::MIN_SHARE_SIZE)/($Apache2::SizeLimit::MAX_PROCESS_SIZE-$Apache2::SizeLimit::MIN_SHARE_SIZE));
# We can't use the super-cool practical mod perl recipe, because
# of how Apache2::SizeLimit (or Linux::Smaps) reports process memory on
Lenny
# It used to be 110Mb, now it's 440Mb. (???)
# And reserve 500Mb for the OS in any case
$MaxClients = int (($mem - 500) / 100_000);
warn "\nMemory: " . int($mem/1000) . "Mb, MaxClients: $MaxClients\n";
</Perl>
--
Cosimo