perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <>
Subject Re: Apache::ASP Singletons
Date Wed, 22 Oct 2003 16:28:55 GMT
Glossop, Ian (I.L.) wrote:
> Hi Josh,
> Seems I encountered the same (pretty much) problem as Dr.Zeilinger:
> I'm going to adopt his solution. However, I'd like to influence your thinking on the
evolution of Apache::ASP.
> Not being a programmer and not raised in the orthodoxy of object orientation, I always
find that one area where Object Oriented Analysis struggles is in dealing with things of bigger
scope than the programs one is writing: the environment, long-lived processes, the OS, clusters
of machines, the Internet ... (how does one represent a corporate Intranet in object-oriented
terms ? Answer: don't even try - use a more appropriate analysis). The concept of a "Singleton"
is really a bit of a fudge to represent a long-lived process that handles a number of possibly
unrelated requests. The problems with such a singleton ASP object you hint at in your discussion.
> If you shift your perspective a little however and think of an ASP singleton as not particularly
related to an Apache request object - but more associated with an Apache (child) server process
that handles requests for one of a number of ASP files then it may start to make a little
more sense.
> The idea is to have a directive in the httpd.conf that creates at server startup a named,
long-lived ASP object that handles requests for a named web application comprising a number
of ASP (and other) files:
> PerlSetVar  ASPSingleton  MyApp

The notion of a single process executing all Apache::ASP requests can be
implemented today via the threaded/worker MPM in mod_perl 2 / Apache 2.

The trick here would be to set PerlInterpMax to 1, and ServerLimit 1,
so that only one thread could run a perl or Apache::ASP script at a time,
leaving the other threads to do the rest, so ThreadsPerChild would be set high.

The setting you suggest SingletonMaxReqs is implemented via the normal
Apache MaxRequestsPerChild.

In order to isolate this singleton server from the rest of mod_perl, one
could have a dedicated server running these requests on a high port and
have Apache mod_proxy/mod_rewrite ProxyPass only certain requests to
that server, but if you were not using other mod_perl handlers, then
this would not be a necessary set up.

Please make sure to CC the Apache::ASP mailing list on future topics
so we can get these discussions going in the general community.



Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.      
NodeWorks Link Checker       

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message