fastcgi, lacking performance over standard cgi

Frank Warmerdam fwarmerdam at GMAIL.COM
Tue Apr 12 17:36:47 EDT 2005


On Apr 12, 2005 5:23 PM, Gregor Mosheh <stigmata_blackangel at yahoo.com> wrote:
> On my dev server I started using MapServer with
> FastCGI support. I compiled mapserver with fastcgi
> support, and the mapserv.fcgi process is started at
> Apache startup. However, there is no performance
> increase, even in PostGIS-heavy maps.

Gregor,

MapServer normally has quite low "start up" costs, and for that
reason it does not normally benefit much from FastCGI.
Exceptions are the database connections with high overhead,
such as Oracle, and SDE.  It was specifically for these two
datasources that FastCGI support was implemented.

I would add that to convince MapServer to "hold open" a
database connection you need to tell it to do so.  This is
accomplished by adding the following on layers for
which you would like to preserve the database connection:

 PROCESSING "CLOSE_CONNECTION=DEFER"

This works for SDE, Oracle and PostGIS, though it gives
relatively little benefit for PostGIS since PostGIS has such
a low connection overhead already.

Actually, the CLOSE_CONNECTION=DEFER thing also
works for OGR datasources, though how much benefit it
gives for them varies greatly depending on how the format
driver is implemented.  In recent tests mapping directly
from S-57 format (via OGR) FastCGI gave a substantial
speed up, mainly because the S-57 data was all being
parsed and held in OGRFeature format in RAM due to
the deferred connection closing.  This doesn't necessarily
scale up to large amounts of data well.

Eventually, I would like to also take advantage of deferred
closing in FastCGI mode for GDAL rasters, but I haven't
yet pursued that option.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list