<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmailquote
        {mso-style-name:gmail_quote;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:1319573819;
        mso-list-type:hybrid;
        mso-list-template-ids:-824020588 1898322204 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:16;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:29.25pt;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Adrian –<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>My first reaction is to wonder why you feel you need MapScript
(which leads to the whole issue of thread safety in the first place). I
would be inclined to build your application as I have done others, using the
.NET/C# environment to process Web requests and then compute an appropriate WMS
request to render the map image required. You would use MapServer in
simple CGI/WMS mode, sending HTTP requests for images which you then retrieve
in your C# code and embed in an output page of your design.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Your user activity seems quite high; an average 10-minute
session with an average 7-second wait between map requests would mean the <i>average</i>
visit requested 85 map views. That’s a very high number! Just
as a data point, users on my TopoZone site average about 30 seconds per map
view (and no, that’s not because the maps are slow to load
<g>). Users tend to navigate quickly, panning and zooming and
selecting layers to get something they want – and then they actually want
to take a moment to look at it.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Shapefiles, properly organized, are almost certainly the fastest
storage option in terms of retrieval. However, I don’t know how
often those data sets change. If your data changes with any frequency,
you will need to either automate the data-organization steps to update the
shapefiles, or store your data in a database. Don’t just put static,
simple data into a database if you’re not going to otherwise use the
database’s capabilities.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoListParagraph style='margin-left:29.25pt;text-indent:-.25in;
mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>-<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ed<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ed McNierney<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Chief Mapmaker<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Demand Media / TopoZone.com<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>73 Princeton Street, Suite 305<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>North Chelmsford, MA 01863<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Phone: 978-251-4242, Fax: 978-251-1396<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a href="mailto:ed@topozone.com">ed@topozone.com</a><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> UMN MapServer
Developers List [mailto:MAPSERVER-DEV@LISTS.UMN.EDU] <b>On Behalf Of </b>adrian
kruk<br>
<b>Sent:</b> Tuesday, January 22, 2008 11:04 AM<br>
<b>To:</b> MAPSERVER-DEV@LISTS.UMN.EDU<br>
<b>Subject:</b> Re: [UMN_MAPSERVER-DEV] Is MapServer Thread-safe?<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Perphaps some results from
mapscript performance tests would be helpful for me. <br>
Here is some details as you wish:<br>
<br>
<b>Environment:</b><br>
QA Server: 2x3GHz Pentium (PRD: 4 - 8 processors) <br>
Application Server: IIS 5.0/6.0<br>
Memory: 3GB<br>
OS: WinXP or 2003 Server<br>
Technology: .NET/C#<br>
Application type: webservice<br>
<br>
<b>Data: </b><br>
Map of Poland, shapefiles, above layers: <br>
roads ( 600k polylines, categorized by attribute in table), <br>
railroads (2K polylines)<br>
towns: (60K points, 3K polygons)<br>
some adminitration districts (regions, subregions, etc, summary: 10Kpolygons in
3 layers)<br>
forest, parks,etc (30K polygons)<br>
lakes and rivers ( 21K polylines, 7K polygons)<br>
<br>
Additional layers: <br>
Labels of almost each layer in good quality (antialiasing) - visible depends on
scale.<br>
Some data from my business client (could be e.g. 100K polygons in 3 layers)<br>
<br>
<b>Example application: </b><br>
Performance requirement: 1000 users sessions/hour.<br>
Users session definition:<br>
Session time: few random (avg. 10) minutes with doing actions zooming, changing
coverage, on/off layers, etc.<br>
Between actions user waits for avg 7 secs. <br>
<br>
WebService provide below functionality:<br>
each user has its own map in session (will consider map pooling), data
filtering (by atributes)<br>
High quaility images like "<a href="http://maps.google.com">maps.google.com
</a>" but one image with 800x600 resolution<br>
<br>
WebService methods:<br>
bytes[] GetImage(sessionID) - getting image<br>
<br>
SetZoom(sessionID, int zoom)<br>
SetRectangle(.....<br>
SetCenter<br>
SetMapSize (default 800x600) <br>
SetLayerVisibility(sessionID, layerid, bool visibility)<br>
PutSymbol( x,y, symbolID)<br>
GetLegend<br>
GetLayerAtributes<br>
DrawLayerFiltered(sessionID, query) - drawing in memory, image with new layer
will be returned by GetImage <br>
...<br>
GetZoom,<br>
GetCenter<br>
etc.....<br>
<br>
<br>
Can mapscript do it (quality and performance)? <br>
How to store data: shapefiles or postgis? Maybe use 2 or 3 harddiscs if it will
<span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>increase</span>
performance?<br>
What about connection pooling to postgis, mapserver has one connection per
process or more?<br>
<br>
Please send be some advice, I will be very <span style='font-size:10.0pt;
font-family:"Arial","sans-serif";color:black'>graceful. </span><br>
<br>
<br>
Best Regards,<br>
Adrian<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal><span class=gmailquote>2008/1/22, Ed McNierney <<a
href="mailto:ed@topozone.com">ed@topozone.com</a>>:</span><o:p></o:p></p>
<p class=MsoNormal>Adrian -<br>
<br>
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. <br>
<br>
- Ed<br>
<br>
Ed McNierney<br>
Chief Mapmaker<br>
Demand Media / TopoZone.com<br>
73 Princeton Street, Suite 305<br>
North Chelmsford, MA 01863<br>
<a href="mailto:ed@topozone.com">ed@topozone.com</a><br>
Phone: +1 (978) 251-4242 <br>
Fax: +1 (978) 251-1396<br>
<br>
-----Original Message-----<br>
From: UMN MapServer Developers List [mailto:<a
href="mailto:MAPSERVER-DEV@LISTS.UMN.EDU">MAPSERVER-DEV@LISTS.UMN.EDU</a>] On
Behalf Of Adrian Kruk<br>
Sent: Tuesday, January 22, 2008 9:37 AM <br>
To: <a href="mailto:MAPSERVER-DEV@LISTS.UMN.EDU">MAPSERVER-DEV@LISTS.UMN.EDU</a><br>
Subject: Re: [UMN_MAPSERVER-DEV] Is MapServer Thread-safe?<br>
<br>
>Why do you think this is a "big limitation"? There are
many MapServer <br>
users, >myself included, running MapServer as a CGI application - including<br>
as a WMS >server - with "many clients running simultaneously".<br>
<br>
What does mean "many" for you?<br>
<br>
>What kind of equipment are you using and what kind of user load do you <br>
expect? >It sounds like you have concluded that a standard CGI
WMS<br>
application of >MapServer is simply unsuitable for you, and I haven't seen<br>
information that >explains why you think that.<br>
<br>
WMS is ok, but I need C# API to create any gis application ( e.g. with<br>
adding/modyfing spatial features, with requested by bussiness client<br>
webservice interface, etc).<br>
<br>
The problem is with scalability with using mapscript. Changing server from 1<br>
processor architecture to 4 performance will increase performance but I <br>
think that not much in really big workload.<o:p></o:p></p>
</div>
<p class=MsoNormal><br>
<br clear=all>
<br>
-- <br>
Pozdrawiam,<br>
Adrian Kruk <o:p></o:p></p>
</div>
</body>
</html>