[mapserver-users] Hiding map= from URL with FastCGI

Russell McOrmond russell at flora.ca
Fri Dec 12 15:12:16 EST 2008


   I am experimenting with running Mapserver via FastCGI. (Apache httpd 
2.2.9, latest fcgi and mod_fastcgi from http://www.fastcgi.com/dist/, 
Mapserver 5.2.1 )

   When in CGI mode we launch separate cgi scripts which look like:

#! /bin/bash
MS_MAPFILE=/data/ourserver/basemap/map/basemap_wms_en.map
export MS_MAPFILE
/data/ourserver/cgi-bin/mapserv


   In this way we don't need to specify a map= URL on the command line.


I tried to do something similar with mod_fastcgi, but it tells me

"loadMap(): Web application error. CGI variable "map" is not set."

If I specify the map= on the URL, then things work.


This leads to a few questions:

   Is it possible to do with FastCGI something similar to what we were 
doing with the CGI version of mapserver?  Do I do this with environment 
variables, or am I left doing some sort of mod_rewrite hacking to add the 
map= into the URL on the fly?

   We have a number of different map files and there seems to be some 
efficiency that could be gained by allowing the same group of fcgi 
mapserver processes to be able to handle all of them, rather than having 
the situation that some processes (accessing more popular maps) end up 
more busy than other processes.  Am I correct in thinking this, or is 
there benefits to having specific mapserver processes that would be 
caching database (Well, ArcSDE) connection information and have that 
sorted within Apache?



Separate thoughts:

   I notice with the ESRI servers you can configure an ArcGIS SOM with 
multiple ArcGIS SOC servers.  The benefit is that the processing can be 
load ballanced across multiple servers.  It appears that something similar 
can be done with mapserver running under fcgi.

   The idea is to run 'lighthttpd' which does load ballancing across a 
number of fcgi processes running on multiple servers.  Then run 
fcgi-mapserver on multltiple servers, allowing each to better split the 
load.

   Has anyone done this?


   I'm also curious what the experience has been comparing CGI vs FastCGI 
with mapserver?  I'm aware that I need to modify our map files to have 
'PROCESSING "CLOSE_CONNECTION=DEFER"' added to them to receive the real 
benefits of FastCGI.  I saw a powerpoint presentation from 2005 
http://mapserver.gis.umn.edu/community/conferences/MUM3/present/session10/msvsarcims
and am curious if something more recent with more recent verious of the 
FLOSS and ESRI software has been done.


Note: I'm not a very experienced GIS person, but I am a long-time FLOSS 
person.  Separate from the current contract I would like to learn how to 
promote FLOSS GEO.  It is a mixed environment with the current contract, 
and I'm always curious about the limitations that have been presented.

Questions I've come up against so far:

   - a claim that ArcGIS server is 5+ times faster than Mapserver.  I'm not 
convinced fair tests have been conducted yet.

   - investigations so far indicating that Mapserver doesn't yet support 
UTF8 character encoding.

-- 
  Russell McOrmond, Internet Consultant: <http://www.flora.ca/>
  Please help us tell the Canadian Parliament to protect our property
  rights as owners of Information Technology. Sign the petition!
  http://digital-copyright.ca/petition/ict/     http://KillBillC61.ca

  "The government, lobbied by legacy copyright holders and hardware
   manufacturers, can pry control over my camcorder, computer,
   home theatre, or portable media player from my cold dead hands!"


More information about the mapserver-users mailing list