[postgis-users] MapServer PostgreSQL and persistent databaseconnections

Paul Ramsey pramsey at refractions.net
Thu Jul 10 10:14:27 PDT 2003


  The eternal question, to connection pool or not to connection pool. :)
The reason why connection pooling is considered an important problem for 
enterprise application developers is... because Oracle is really slow at 
establishing a connection. Really, that is why! PostgreSQL connections times 
are inconsequential. In the context of a process as computationally intensive 
as Mapserver, PgSQL connections times might as well be considered to be zero.
  This gets discussed every month or so on the Mapserver list, and the bottom 
line is that 99% of your processing time for a given map creation will be 
spent retrieving and rendering the data. Connection time for PostgreSQL is 
completely ignorable in term of impact on system load. 
  For Oracle and ArcSDE, connection time is non-trivial, and that is a 
problem.
  Because there are some connection time issues with some of the backends, for 
Mapserver 4.0 there has been an enhancement to ensure that database 
connections are pooled PER MAPPING INVOCATION. So within a particular 
instantiation of the mapserv CGI, only one connection to each database is 
used. So if I have 15 ArcSDE layers in my map, I will only connect ONCE, not 
15 times.
  The infrastructure of inter-layer connection pooling exists in Mapserver 
4.0, and has been implemented on ArcSDE connections only, so far, but is 
completely reusable for OracleSpatial and PgSQL layers. The implementation for 
those layers just needs to be done.

Yours,
Paul

Quoting Hubert Fröhlich <hubert.froehlich at bvv.bayern.de>:

> 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
> 
> 
> --
> 
------------------------------------------------------------------------------
-
> Dr.-Ing. Hubert Fröhlich
> Bezirksfinanzdirektion München
> Alexandrastr. 3, D-80538 München, GERMANY
> Tel. :+49 (0)89 / 2190 - 2980
> Fax  :+49 (0)89 / 2190 - 2459
> hubert.froehlich at bvv.bayern.de
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 






More information about the postgis-users mailing list