httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: What happens, when a CGI program is invoked?
Date Wed, 05 Dec 2012 07:01:18 GMT

On 5 Dec 2012, at 03:57, Mikhail T. wrote:

> Hello!
> 
> From my (limited) investigation, it would appear, that in order to invoke a vanilla CGI
script, httpd is created and goes through all of the modules' initialization and then, immediately,
clean-up functions...
> 
> Is that right? Some of these callbacks are fairly heavy and, in most cases, the init/destroy
cycle is useless... Both websh and mod_rivet, for example, seem to initialize a Tcl-interpreter
first only destroy it afterwards -- completely pointless, when a CGI-script is invoked.

I take it you're talking about a CGI script running under a general-purpose
regime such as mod_cgi, rather than being run by the Tcl interpreter
you're querying?

Without looking at mod_rivet or websh, I'll answer "maybe".

There are a number of processing phases.  Any module can hook a
function in to any of those phases, and it'll run at the appropriate point.

That means it's entirely possible that a module could launch a Tcl
interpreter on every request.  That would indeed impose a performance
overhead, and good module design would ensure it only ever happens
when a Tcl interpreter is going to be used.  There may of course be
use cases where the interpreter is indeed required in one or more earlier
request phases before launching a CGI script.

Back to that "maybe" answer, I don't know how well mod_rivet or websh
are written, and whether they might impose a gratuitous overhead.
Perhaps you could raise your concerns with their developers?

-- 
Nick Kew
Mime
View raw message