[mapserver-users] Mapscript and Perl CGI::MiniSvr module

Alex Rice alex_rice at arc.to
Fri Aug 9 01:09:29 EDT 2002


Has anyone messed about with Perl Mapscript and the CGI::MiniSvr module?

Running a CGI perl script and loading the CGI perl module and the 
Mapscript perl module has a lot of overhead and will noticeably 
slow you down. Yeah I know it's just noise compared to reading 
many MB of shapefiles, but another way to consider it is: you 
don't want to make your web app any slower than it already is 
just by using a plain old CGI script. If it can be worked around.

CGI::MiniSvr is kind of like a temporary mod perl, except it has 
nothing to do with Apache DSOs.  And it doesn't require Fast CGI. 
Instead it forks a mini httpd process and temporarily maintains 
the state of the web application. This means that one could do 
something like this:

- load the mapscript module (only once).
- load the CGI module (once).
- read the mapserver .map file (once)
- create some other mapserver objects (once)
- fork the mini server.
- then handle a bunch of requests from a particular client on 
port xxxxx.
	->tweak mapserver objects
	->perform queries
	->generate maps
	->etc
- timeout after a short while, how long depending on the server load.

OK, I haven't actually got it working yet, but I thought it was 
neat enough to share.

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice at arc.to
alrice at swcp.com





More information about the mapserver-users mailing list