Is MapServer Thread-safe?

adrian kruk adrian.kruk at GMAIL.COM
Tue Jan 22 11:03:34 EST 2008

Perphaps some results from mapscript performance tests would be helpful for
Here is some details as you wish:

QA Server:  2x3GHz Pentium (PRD: 4 - 8 processors)
Application Server: IIS 5.0/6.0
Memory: 3GB
OS: WinXP or 2003 Server
Technology: .NET/C#
Application type: webservice

Map of Poland, shapefiles, above layers:
roads ( 600k polylines, categorized by attribute in table),
railroads (2K polylines)
towns: (60K points, 3K polygons)
some adminitration districts (regions, subregions, etc, summary: 10Kpolygons
in 3 layers)
forest, parks,etc (30K polygons)
lakes and rivers ( 21K polylines, 7K polygons)

Additional layers:
Labels of almost each layer in good quality (antialiasing) - visible depends
on scale.
Some data from my business client (could be e.g. 100K polygons in 3 layers)

Example application:
Performance requirement: 1000 users sessions/hour.
Users session definition:
Session time: few random (avg. 10) minutes with doing actions zooming,
changing coverage,  on/off layers, etc.
Between actions user waits for avg 7 secs.

WebService provide below functionality:
each user has its own map in session (will consider map pooling), data
filtering (by atributes)
High quaility images like "" but one image with 800x600

WebService methods:
bytes[] GetImage(sessionID) - getting image

SetZoom(sessionID, int zoom)
SetMapSize  (default 800x600)
SetLayerVisibility(sessionID, layerid, bool visibility)
PutSymbol( x,y, symbolID)
DrawLayerFiltered(sessionID, query) - drawing in memory, image with new
layer will be returned by GetImage

Can mapscript do it (quality and performance)?
How to store data: shapefiles or postgis? Maybe use 2 or 3 harddiscs if it
will increase performance?
What about connection pooling to postgis, mapserver has one connection per
process or more?

Please send be some advice, I will be very graceful.

Best Regards,

2008/1/22, Ed McNierney <ed at>:
> Adrian -
> Well, what really matters is what "many" means to YOU and your
> application; my MapServer applications are probably quite different from
> yours, so if I have 2,000 simultaneous users that doesn't really tell you
> anything.  If you can describe it in as much detail as possible, then it
> will make it much easier for us to give you advice.  There are quite a few
> serious production implementation of both MapServer CGI and MapScript
> applications.  And, as Dan correctly points out, a different tool might be
> even better for you.
>      - Ed
> Ed McNierney
> Chief Mapmaker
> Demand Media /
> 73 Princeton Street, Suite 305
> North Chelmsford, MA 01863
> ed at
> Phone: +1 (978) 251-4242
> Fax: +1 (978) 251-1396
> -----Original Message-----
> From: UMN MapServer Developers List [mailto:MAPSERVER-DEV at LISTS.UMN.EDU]
> On Behalf Of Adrian Kruk
> Sent: Tuesday, January 22, 2008 9:37 AM
> Subject: Re: [UMN_MAPSERVER-DEV] Is MapServer Thread-safe?
> >Why do you think this is a "big limitation"?  There are many MapServer
> users, >myself included, running MapServer as a CGI application -
> including
> as a WMS >server - with "many clients running simultaneously".
> What does mean "many" for you?
> >What kind of equipment are you using and what kind of user load do you
> expect?  >It sounds like you have concluded that a standard CGI WMS
> application of >MapServer is simply unsuitable for you, and I haven't seen
> information that >explains why you think that.
> WMS is ok, but I need C# API to create any gis application (e.g. with
> adding/modyfing spatial features, with requested by bussiness client
> webservice interface, etc).
> The problem is with scalability with using mapscript. Changing server from
> 1
> processor architecture to 4 performance will increase performance but I
> think that not much in really big workload.

Adrian Kruk
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the mapserver-dev mailing list