I realise that KeepAlives are discouraged in combination with mod_perl.
However, for a project I'm working on, I would like to try to have
KeepAlive On to allow for _very_ quick response times. I can set the
Content-Length: header for my output, so there is no problem there. And
the way the things will be set up, is that every user only uses 1
persistent connection (just for the html/xml only, other stuff will be
retrieved from other servers). I'm thinking of KeepAliveTimeouts of up to
300 seconds. You could think of it as session caching on a connection.
The data served consists of potentially many millions of newsgroup and
mailing list messages (yes: we'll be doing Perl-related stuff also). Some
data (which newsgroups and mailinglist, which start of threads, etc) will
be loaded at startup of the server and shared "globally" by all apache
children. Data pertaining to a particular newsgroup will be loaded on
demand in the apache child handling the request.
I see the following potential problems with this approach:
1. To facilitate memory management, I would like to have the apache child
terminate whenever the keep-alive connection is broken or has timed
out. There does not seem to be a handler that will handle the end of a
keep-alive connection yet. Is that correct? Is there a way around it?
2. when a user initiates another request before the first request is
finished, a different apache child will be used to service the request,
thereby breaking the other persistent connection. This may cause several
children to co-exist with essentially the same data internally, but not
being shared at the os memory level.
I guess my questions really are: does such an approach make sense? Are
there solutions to the problems mentioned above? Are there any pitfalls
that I didn't realise yet?
Any feedback would be greatly appreciated.
Elizabeth Mattijsen