[BNE-PM] cgi architecture

David Bussenschutt d.bussenschutt at mailbox.gu.edu.au
Thu Sep 26 03:54:31 CDT 2002


Well, for the moment, I'm doing OK, so we'll use the "suck-it-and-see" 
approach...if it's too slow, I'll re-engineer some of the communications.  
I must say that adding a local "daemon" (even if just to keep the sockets 
open the whole time) seems to me like a reasonably simple thing to do...I 
just relocate the functionality from my cgi into a daemon, wrap it into a 
while (1) loop, and wait for requests..... Hmmm I think I may consider 
this further...... but isn't that sort-of what mod_perl is supposed to 
allow me to do? anyway.... I wonder.....   does anyone out there use 
mod_perl , and can give me some tips etc. (I think I need to read some 
more man pages too!)

David.
--------------------------------------------------------------------
David Bussenschutt        Email: D.Bussenschutt at mailbox.gu.edu.au
Senior Computing Support Officer & Systems Administrator/Programmer
RedHat Certified Engineer. 
Member of Systems Administrators Guild of Australia.
Location: Griffith University. Information Technology Services
           Brisbane Qld. Aust.  (TEN bldg. rm 1.33) Ph: (07)38757079
--------------------------------------------------------------------




Don.Simonetta at mincom.com
26/09/2002 02:44 PM

 
        To:     derek at wedgetail.com, d.bussenschutt at mailbox.gu.edu.au
        cc: 
        Subject:        RE: [BNE-PM] cgi architecture


Sorry for the late response on this one - I somehow missed it when it
arrived.

Just wanted to add that we have a situation where we use a similar
architecture to that described by Derek below - only for completely
different reasons. In our case its so that Internet access can run a
process behind our firewall (to access an internal database via intranet
CGI).


-----Original Message-----
From: owner-brisbane-pm-list at pm.org
[mailto:owner-brisbane-pm-list at pm.org] On Behalf Of derek at wedgetail.com
Sent: Friday, 20 September 2002 16:20
To: d.bussenschutt at mailbox.gu.edu.au
Cc: brisbane-pm-list at happyfunball.pm.org
Subject: Re: [BNE-PM] The Perl one-liner

David Bussenschutt wrote:
 > I expect that I will eventually run in
> mod_perl, but I haven't needed that yet (or figured it out either)
;-)
> 

I think you're going to have to look at mod_perl before too long. I've 
never done any CGI/Web app stuff whatsoever, so I can't really say how 
easy that will be.

Another approach would be to get all that work out of the CGI program, 
and into a server that sits on your machine permanently, and does all 
the "grunt work".

So, your setup looks like this (set your fonts to "fixed width"!):

+----------+                             +--------------+
| CGI      |  CORBA/SOAP/adhoc protocol  |  Perl server |
| "script" |---------------------------->|  process     |
+----------+                             +--------------+

So, your CGI script just connects to the server, passing the arguments, 
like say a cookie and some form fields, and gets back shiny new HTML to 
display. The server never dies, so not only is it "warmed up", but it 
can also cache database connections, keep those 6-12 sockets open for 
reuse, cache data from other sources, and so on ad infinitum. You can 
also move the server to a different, more powerful machine, or even 
replicate it across many machines!

You can use any protocol you like, ranging from standard, like CORBA or 
SOAP (which has the advantage that you can switch the server to 
Java/Python/C++/C at will without writing a bunch of code), or just make

up your own little ASCII protocol and use that.

Anyway, even if you do use mod_perl, I think this design still has many 
benefits.

--
D.



-- 
This transmission is for the intended addressee only and is confidential 
information.  If you have received this transmission in error, please 
delete it and notify the sender.  The contents of this e-mail are the 
opinion of the writer only and are not endorsed by the Mincom Group of 
companies unless expressly stated otherwise.







More information about the Brisbane-pm mailing list