[Mapserver-users] Re: [postgis-users] MapServer PostgreSQL and persistent database connections

Jan Hartmann jhart at frw.uva.nl
Thu Jul 10 06:24:21 EDT 2003


Hubert,

This has been a hot topic for some while. At the beginning of this year 
I implemented persistent database connections for one MapServer session, 
so more than one layer could make use of the same connection. Recently, 
Frank Warmerdam has announced that he was going to work on a FastCGI 
wrapper for MapServer CGI, which will keep MapServer in memory, so that 
database connections can be held open across different CGI calls. This 
will definitely be in 4.1 or later; we don't know exactly how difficult 
this will be. See the thread on:

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0306/msg00324.html

In my experience, PostGIS is very efficient in opening new connections. 
In my tests with a hunderd layers the difference between either one or a 
hunderd connections was about 5 percent. Oracle or SDE on the other hand 
have very big connecting overheads. Persistent connections for Oracle 
have not been implemented yet, but both Refractions and CERL have 
announced going to work  on it. Steve Lime has programmed the SDE part, 
and I think he got large speedups as a result.

Jan

Hubert Fröhlich wrote:
> Hi lists,
> 
> I use UMN MapServer with PostGIS.
> 
> When programming web applications with, say, PHP, Apache and PostgreSQL, 
> I can speed up database performance by keeping database connections 
> persistent and, therefore avoiding overhead by login and 
> authentification procedures.
> 
> When using MapServer with PostGIS in a CGI-style way like in the 
> documetnation examples, I guess that I have to open and reopen the 
> PostGIS connection every time I start a mapserv process (at least I 
> haven't found a different way) because the database connection is 
> defined in the mapfile.
> 
> Now my question: Is it possible that MapServer can control database 
> connections  and keep them persistent?
> Or may be this an issue for the development team?
> 
> Any hints will be greatly appreciated.
> 
> Greetings,
> 
> Hubert
> 
> 

Jan Hartmann
Department of Geography
University of Amsterdam
jhart at frw.uva.nl




More information about the mapserver-users mailing list