Mod_perl eating resources

From my scans of the RT code, I’m not too sure it is set up to share
resources well under mod_perl. There is a lot of embedded requires
within functions which causes code to be loaded at run time, rather
than at apache startup time. By making perl code load up at start
time, you get the benefit of sharing the memory needed for it.
Ideally, any code that is often used within RT should be loaded by
the webmux script. That is, anywhere you see a “use XXX” within
modules that WebRT needs, those should also be in the startup script.

I’m pretty confident that I have most everything necessary in the long list
of modules in webmux.pl. The later, repeated calls to use are ignored.

Speaking of “use …” lines, it seems that some of the code assumes
that this happens at run time not compile time. This is not true…

It happens at module compile-time. if a module is required part way
through program execution, its ‘use’ directives get evaluated then.
This is particularly useful when you don’t want to compile all 50 kloc
of RT for every invocation of the CLI.

The main case where this is different is with scrips. which are a whole
other kettle of fish.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

Hi,

Does anyone have this problem :
When using :
PerlModule Apache::DBI
PerlFreshRestart On
PerlRequire /usr/local/rt/bin/webmux.pl

SetHandler perl-script
PerlHandler RT::Mason

every httpd process becomes 18M. Without it, it’s only 8M.

I would like to use the web interface, but not if it eats 10MB extra per
process… that means 100MB in total !

Kind greetings,

Wim Godden

I would like to use the web interface, but not if it eats 10MB extra per

process… that means 100MB in total !

You may be confusing size (SIZE) and resident size (RSS). SIZE is the
size of the entire process, including shared memory segments. Resident
size is the real amount of RAM a process is taking.

Apache is quite good in sharing code. In my setup, each httpd takes
about 18MB (SIZE), but is only 4MB resident (RSS). So, 14MB is shared
between httpd processes. Since we usually have about 40 processes, this
means Apache uses 160MB of real RAM. We have 256, so nothing to worry.

Martin

Martin Schapendonk, martin@schapendonk.org, Phone: +31 (0)6 55770237
Student Information Systems and Management at Tilburg University

“MS” == Martin Schapendonk martin@schapendonk.org writes:

MS> Apache is quite good in sharing code. In my setup, each httpd takes
MS> about 18MB (SIZE), but is only 4MB resident (RSS). So, 14MB is shared
MS> between httpd processes. Since we usually have about 40 processes, this
MS> means Apache uses 160MB of real RAM. We have 256, so nothing to worry.

You’re confusing non-RSS with shared memory. Determining the amount
of memory that is shared is difficult, and is highly system
dependent. The RSS number only indicates the resident set size (ie,
RAM used) which can include shared memory. The rest of the process
size is some backing store, either the file system or swap.

You’re confusing non-RSS with shared memory. Determining the amount

of memory that is shared is difficult, and is highly system

dependent. The RSS number only indicates the resident set size (ie,

RAM used) which can include shared memory. The rest of the process

size is some backing store, either the file system or swap.

OK, I thought that -roughly speaking- the size minus the resident set
size was the shared memory, at least for Linux. But I might be mistaken.

Martin

Martin Schapendonk, martin@schapendonk.org, Phone: +31 (0)6 55770237
Student Information Systems and Management at Tilburg University