[svlug] run-time costs of HTTP POST
scott at doubleu.com
Sat Oct 4 10:10:11 PDT 2003
On Sat, 4 Oct 2003, Rick Kwan wrote:
> For me, CPU time is a concern because of the delay that the user
> experiences, particularly when you walk them through a sequence of form
> When I tried this about a year ago, I noticed that simple HTML pages
> came back to me almost immediately whereas Perl-CGI responses took close
> to 3 seconds. The platform was my Mac OS X laptop with Apache and
> Netscape and no other significant load. (The target was a couple of
> Linux machines.) I rewrote the code into PHP and got down to roughly
> 1-2 seconds per HTTP request. (BTW, I had never done PHP before.)
That is _way_ long, even for cgi-bin. I have tons of cgi-bin one-offs
that I use around here, and if they were taking more than a second, I'd
notice it. This is on an Athlon 2100+ running Linux. There definitely is
a startup downside, which, of course, you almost always _can_ reduce with
some effort poking around. The minimum time you can achieve will
definitely be higher.
> Admittedly, modules like mod_perl help, if you have access to them. That
> depends on the ISP or other provider (like my laptop :-). Portability
> was a concern; I didn't find mod_perl uniformly available. So I
> serialized ... a lot.
mod_perl is seldom available, I think because it's so intrusive into
Apache. I almost wish they had written it as a distinct server, then you
could just proxy it and be done.
> 2. Use C/C++, build native code, and cut out the run-time
> parsing costs. (I know, I'm thinking about the development
> costs also.)
Aiighh! OK, so awhile back I heard about this project like unto php or
mason or whatever (meaning "code mixed with html") which could compile
either to an Apache module or a stand-alone CGI program. When I say
"compile", I don't think it did native-code compilation, instead I think
it serialized the pre-parsed code and bound it with a wrapper to make it
look like an executable. [OK, maybe they did better, like writing out a
direct-threaded-code representation or something.]
BUT I CAN'T REMEMBER THE NAME OF IT! The project had run for long enough
that I had seen a couple follow-up posts announcing new versions, but I no
longer subscribe to whatever mailing list this was on (probably the Apache
modules list). And nothing I saw on Freshmeat rang a bell.
Arrgghh! Maybe someone else on the list remembers it.
More information about the svlug