Memory Issues

[prev] [thread] [next] [Date index for 2005/02/10]

From: Leo
Subject: Memory Issues
Date: 18:56 on 10 Feb 2005
Hello all:

I have apache2 setup with virtual domains.  I am thinking about hosting 
some mod_perl pages in a number of domains.

I don't anticipate much traffic for now, so I can experiment with this 
stuff :)

Issue 1:

What strategies can I use to separate or isolate memory per virtual 
domain.  I have read some of the documentation about reducing memory 
usage and increasing performance of apache mod_perl processes. 

As a slight adaptation, I could have an apache server dedicated to each 
virdual domain waiting on some high port number.  And configure a 
lightweight apache on port 80 (serving lightweight stuff for all domain) 
to redirect (using mod_rewrite perhaps) domain specific domain mod_perl 
calls to those high port numbers?  This scheme certainly would make it 
easy to add extra machines when needed.  However the configuration of my 
lightweight apache seems daunting.  I would make sure that those high 
port numbers are firewalled so only my lightweight machine can see those 
ports...

Issue 2:

The various apache processes seem to each maintain a copy of domain 
specific data.  For now I have an "application" variable that's used to 
keep everything in sync.  During each request I tie the application 
session and check if a "mod counter" has been incremented, if so I 
reread the application data else I use the local copy.  The data is 
mostly readonly and dependent on  internal conditions.

One strategy that I have though of :

Use the startup handler (called during startup before the child 
processes are spawned right?) to calculate what the "application data" 
should be and intialize the tied "mod counter" hoping that it will never 
change :(.   I suppose when the machine goes into production, if changes 
should occur infrequently or upon modification of certain data then you 
simply restart the server and thus keep this readonly "application" 
stuff in a shared memory space.

Perhaps I may even open two types of  "application data": the kind that 
is almost guarenteed to remain static, and everything else and use two 
sessions to keep it all in sync.

What other strategies may be employed to treat such data?  Is there a 
way update data in shared memory without apache creating a local copy?

Any comments are welcome; thanks in advance.

Leo

Memory Issues
Leo 18:56 on 10 Feb 2005

Re: Memory Issues
Perrin Harkins 19:20 on 10 Feb 2005

Re: Memory Issues
Leo 19:48 on 10 Feb 2005

Re: Memory Issues
Perrin Harkins 20:37 on 10 Feb 2005

Generated at 10:21 on 11 Feb 2005 by mariachi v0.52