[mapserver-users] Faster MapServer Stand-Alone?

Frederik Ramm mapserver at lists.remote.org
Wed Sep 5 20:02:54 EDT 2001


Hi,

   I've been looking at using the MapServer for a project of mine
in which I have to create map images with minimal delay.

Please correct me if I'm wrong but I got the impression that,
basically, the MapServer will always run as a CGI. That means that for
each request it will not only start a new process but also open and
parse the map and all shape files. Then, it creates an output file
which will be read by the web server in order to pass it on to the
client.

I haven't run any load tests but it seems obvious that this wastes a
lot of performance. Hence I played around and built a stand-alone web
server (which does the listen, accept, and fork) and then produces an
image, along the lines of shp2img but at the end the image is sent out
on the socket without further temp file creation. For the client, the
whole operation looks identical to a standard CGI request. Of course
my server is nowehere near as efficient and configurable as, say, an
Apache server, but it isn't meant as a replacement for those - my
server doesn't serve files or CGI scripts, just generated maps.

Of course this whole process only improves things if I can read and
pre-process as much of the map data as possible. Reading the map file
in advance is trivial (in my scenario, the map file will be the same
for all requests, but the extent and maybe the layer selection will
change). I might want to support different projections but I could
perhaps try and pre-initialize the relevant PROJ structures. I have
not looked at the shapefile processing too closely but it seems that
the shapefiles are parsed for each request. Is the shapefile format
already so efficient that placing the shapefiles on a RAM disk (or
using a decent buffering file system) will create near-optimum
performance, or would it be worthwhile to try and pre-load all the
shape data from the start?

Maybe someone else has played around with this concept. Especially,
I'd like to know how far I can go along this road without having to
re-write large parts of the MapServer. Of course I'd prefer to just
write a MapServer add-on but if it turns out that pre-loading stuff
is just not supported anywhere by any means, then my project would
become one hell of a "diff-and-patch" exercise in no time :-)

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N48°59.94 E008°24.36'





More information about the mapserver-users mailing list