MapServer Binaries with SDE support?

Brock Anderson banders at REFRACTIONS.NET
Fri Jan 14 11:45:49 EST 2005


Peter,

In the past I have used "mod_fastcgi-2.4.2-AP20.dll", and renamed it to
mod_fastcgi.so.  It worked for me, although I don't know if that is the
recommended approach.   If the file you used is working, then there
probably isn't any immediate need to upgrade, although it is usually
better to use the latest version.

Do you get an error response from MapServer when you request your SDE
layers?  If there is a problem with your connection information,
MapServer will usually return an error message explaining which layer
failed and why.  If you simply get a blank image back from MapServer,
you could have any number of problems.

I do recommend a couple changes which will help with SDE performance
(once you get it working):

1. Add the following line to the SDE layers in your mapfile.  It will
give you persistent connections.  If you don't do this, you won't get
the full benefit of fastCGI.

    PROCESSING "CLOSE_CONNECTION=DEFER"

2. Remove SDE.DEFAULT from the end of your DATA line.  I think if the
version is not specified MapServer will assume the default version, and
will benefit from certain optimizations.

Brock Anderson
<http://www.fastcgi.com/dist/mod_fastcgi-2.4.2-AP20.dll>

Peter.VonGaza wrote:

>Hi Brock,
>
>Thanks for you information.
>
>I installed the files from the zip. The readme.txt says to go to
>www.fastcgi.com to get mod_fastcgi.so. The only file that I could
>Find was in the "old" directory:
>
>http://www.fastcgi.com/dist/old/mod_fastcgi-2.4.0-AP2.so
>
>So I just grab that and renamed it "mod_fastcgi.so". Is there
>Another file somewhere else?
>
>At the command prompt "mapserv -v" gives me:
>MapServer version 4.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
>SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=FASTCGI INPUT=SDE
>INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG
>
>Looks OK to me.
>
>My old MapServer apps come up fine, but I still can't display an ArcSDE
>Layer. How do I tell if it my connection string or something else. I
>Figure it must be my connection string. I am trying something like this:
>
>  LAYER
>    NAME "SDE URN"
>    STATUS ON
>    DATA "BASEA.URN,SHAPE,SDE.DEFAULT"
>    TYPE LINE
>    CONNECTIONTYPE SDE
>    CONNECTION "mysde.gov.yk.ca,port:5151,sde,username,password"
>    UNITS METERS
>    SIZEUNITS PIXELS
>    CLASS
>      NAME "SDE Roads"
>      STYLE
>        SYMBOL 0
>        OUTLINECOLOR 0 255 0
>        SIZE 1
>        MINSIZE 1
>        MAXSIZE 100
>      END
>    END
>  END
>
>The only variable that could be wrong is "sde". We leave the Database
>Field blank when connecting in ArcCatalog. I've tried "null", ' ', and
>"sde". Where to I start? How do I tell if I am hitting our ArcSDE?
>
>Thanks,
>Peter
>
>
>Brock Anderson wrote:
>
>
>
>>You can download Win32 binaries for Mapserver with SDE and FastCGI
>>support here:
>>
>>
>
>
>
>>ftp://ftp.refractions.net/pub/refractions/mapserver/mapserver4.4.zip
>>
>>
>
>
>
>>There is a readme file in the archive that should help you set it up.
>>Let me know if you run into trouble.
>>
>>
>
>
>
>>Brock Anderson
>>
>>
>
>-----------------------------------------------------------------------
>
>
>
>>Paul Ramsey wrote:
>>
>>
>
>
>
>>Hi Peter,
>>
>>On 12-Jan-05, at 5:47 PM, Peter.VonGaza wrote:
>>
>>
>>
>>>Do you have any recommendations on how I should set things up? I am
>>>not a MapServer expert - I just know the basics. What exactly is
>>>fastcgi and are
>>>there any precompiled binaries available? I've just downloaded the
>>>binaries
>>>that Assefa pointed me to:
>>>
>>>
>>Once you get into database-backed data sources, the way Mapserver runs
>>can become an issue. Mapserver is a CGI process, which means for every
>>map request Mapserver goes through a complete startup, read config,
>>generate map, shutdown cycle. There is no Mapserver process running
>>between requests. For database data sources, that means Mapserver has
>>to establish a connection for every individual map request.  It can
>>take a long time to establish an SDE connection (in BC, we found
>>between 1 and 2 seconds). That means 1-2 seconds are burned before the
>>map even starts rendering.  That's pretty bad news if you want a fast
>>map server, and as you have found in your testing, under the right
>>conditions Mapserver is a very fast map server indeed.
>>
>>So what is the solution? What if Mapserver did not shut down after
>>every map request? What if it stayed running, and maintained database
>>connections between map requests? That would mean map requests would
>>not have to pay a connection penalty to pull data out of ArcSDE,
>>because the connection would already be there, waiting.
>>
>>This is what FastCGI does. It is a general purpose technology that
>>allows programs with a high startup overhead (such as Mapserver
>>connecting to ArcSDE) to stay running continuously, and provides a
>>means for Apache to broker requests to the running processes.
>>
>>Brock will send you a message tomorrow with a link to precompiled
>>windows binaries with FastCGI and ArcSDE support, and some Apache
>>configuration snippets to run Mapserver in FastCGI mode.  If you are
>>looking to demonstrate Mapserver performance against ArcSDE, you
>>really have to use FastCGI.
>>
>>



More information about the mapserver-users mailing list