<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD><TITLE>RE: [UMN_MAPSERVER-USERS] System Configuration</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<STYLE>@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times New Roman","serif"; mso-style-priority: 99; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
P.MsoListParagraph {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; mso-style-priority: 34
}
LI.MsoListParagraph {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; mso-style-priority: 34
}
DIV.MsoListParagraph {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; mso-style-priority: 34
}
SPAN.EmailStyle18 {
COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
page: Section1
}
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 vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>Ed,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>I very much appreciate your help. Very
insightful. </FONT></SPAN>Yes expectations are 50,000 users at least at the
same time.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>Disk subsystem RAID 10 and NTFS.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>Changing the mode sounds like a very good idea and I am
guilty as charged - I am writing to temporary files on the server. I
have a gut feel that this is the big slowdown in our application. I could
not find where to change the mode that you talk about. Somehow slipping through
the fingers . . . </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>I must have to alter this process that I am
using: </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>1. Image generated using PHP with calls
$map->draw() and $image->saveWebImage() </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>2. Definition of storage location in the mapfile
by properties ImagePath and ImageURL</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>3. The image name and path are substituted in my
HTML code generation by referencing the name generated in 1
above.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>What part am I missing? Can I somehow have the image
generated and saved on the users machine directly and reference that
instead? Now I am showing some lack of understanding for
sure.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2>All your suggestions are great. Makes perfect sense,
anything that can use direct access instead of having to filter and
process improves the speed. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=431133222-08112007></SPAN><SPAN
class=431133222-08112007></SPAN><SPAN class=431133222-08112007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=431133222-08112007>Thanks
again.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV align=left><FONT face="Dutch801 Rm BT" size=2>Bruce Cheney</FONT></DIV>
<DIV align=left><FONT face=Arial color=#000080 size=2><STRONG>Gateway Mapping,
Inc</STRONG></FONT></DIV>
<DIV align=left><FONT face=Arial color=#0080ff size=2><A
href="http://www.gatewaymapping.com/">www.gatewaymapping.com</A></FONT></DIV>
<DIV align=left><FONT face=Arial color=#808080
size=2><EM>801.221.7656</EM></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><EM><FONT
face=Arial color=#808080 size=2></FONT></EM><EM><FONT face=Arial color=#808080
size=2></FONT></EM><EM><FONT face=Arial color=#808080
size=2></FONT></EM><EM><FONT face=Arial color=#808080
size=2></FONT></EM><EM><FONT face=Arial color=#808080 size=2></FONT></EM><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Ed McNierney [mailto:ed@topozone.com]
<BR><B>Sent:</B> Thursday, November 08, 2007 2:59 PM<BR><B>To:</B> Bruce Cheney;
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> RE: [UMN_MAPSERVER-USERS]
System Configuration - [SPAM] Email found in subject<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Bruce
–<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Thanks;
that’s a good start. 5,000 requests at a time is a lot. If your
estimate the average user will look at a map for 10 seconds before requesting
another one, you’re talking about 50,000 simultaneous human
users.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Thanks
for posting the map file – that helps. There is one huge thing you should
be aware of and think about right away – the difference between mode=browse and
mode=map. If you are using browse mode with an HTML template (as it
appears you are) you should reconsider that decision. When you use
MapServer in browse mode, it needs to generate the map image, legend image, etc.
and then <I>write them all to a local disk</I> before returning an HTML template
to the client with the URLs of those images embedded in it. Writing to
disk is the slowest thing you can do on your server. Having 5,000
simultaneous disk writes, with simultaneous reads to the same disk, is very
nearly pure evil. That is a huge drag on performance. You really
can’t sustain nearly as many users on a given machine in browse mode as you
could in map mode. What kind of disk subsystem is being used for the temp
files?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Map
mode (mode=map) is a simple HTTP request for an image, and the image, after
being built, is sent directly to the client with no disk I/O involved.
<I>Much</I> nicer. <I>Much</I> faster.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If
you must use browse mode, then I’d suggest you create a RAM disk to hold the
temp images, with appropriate monitoring to clean out old files promptly.
But can you pre-build a set of legends, etc. so you can just embed those and not
crank them out every time? You can also get some benefit from storing our
input shapefiles on a RAM disk, but don’t devote any RAM to that purpose if
you’re still writing temp files to hard disk.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Let
me first toss off a few generic suggestions that probably won’t help much but
are worth doing:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoListParagraph
style="TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><![if !supportLists]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><SPAN
style="mso-list: Ignore">1.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Get
rid of unused fonts in your font file. MapServer will reach out and touch
each one for each map request.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph
style="TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><![if !supportLists]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><SPAN
style="mso-list: Ignore">2.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If
your shapefiles don’t change often, preprocess them to create a separate
shapefile for each CLASS, so you don’t have to filter as
much.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph
style="TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><![if !supportLists]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><SPAN
style="mso-list: Ignore">3.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If
you must use CLASSes, organize them so the most commonly-used class comes first
in each LAYER.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph
style="TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><![if !supportLists]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><SPAN
style="mso-list: Ignore">4.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If
you have a certain number of combinations of shapefiles used in a given request,
create multiple map files with only those layers. For example, if your 12
layers are one set of 4 base layers that are always used, and then 8 more layers
only one of which is displayed at a time, create 8 map files, each with only 5
layers instead of 12 – the four base layers and one specific overlay
layer. Then use your application code to figure out which map file to
select.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">And
make sure you’re using shptree to generate spatial indexes for all your
shapefiles!<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">This
looks like it should be an application capable of running pretty darn
quickly.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoListParagraph
style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo4"><![if !supportLists]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><SPAN
style="mso-list: Ignore">-<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Ed<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN-LEFT: 0.75in"><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Ed
McNierney<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Chief
Mapmaker<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Demand
Media / TopoZone.com<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">73
Princeton Street, Suite 305<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">North
Chelmsford, MA 01863<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><A
href="mailto:ed@topozone.com">ed@topozone.com</A><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Phone:
+1 (978) 251-4242<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Fax:
+1 (978) 251-1396<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> UMN MapServer Users
List [mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Bruce
Cheney<BR><B>Sent:</B> Thursday, November 08, 2007 12:17 PM<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS]
System Configuration<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Many good
questions. I will see if I can catch them all. A bit on the nature of the
application.</SPAN> <o:p></o:p></P>
<UL type=disc>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">We are only using
vector data (we assumed that the raster would slow it down).</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">We are serving many
different maps stored separately with the same composition of layers. Each map
has 6 layers (4 polygon and 2 point layers for labeling). </SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Each of the
different map sets has differing quantities of features. For the most
significant layers they average around 10,000 features but may be as high as
100,000. </SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">A majority of the
requests are to display a small area of one of the maps so the rendering
focuses in to a few features. The user will query a database which will
allow for viewing the map that is zoomed to the area of
interest.</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">No layer
reprojecting (we assumed this would also slow it down).</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">The output map is
PNG with dimensions 419 X 403.</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">We are using
PHP_mapscript to generate the requests. The parameters for the map
generation come from a database and the user requested location. So
there are a few lines of code to find the location on the map and generate the
images.</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">The mapfile
contains about 12 layers. Several layers to display the primary polygon
layer thematically and a couple extra to show the polygons with outlines.
</SPAN><o:p></o:p>
<LI class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l3 level1 lfo1"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Data is stored in
Shapefiles</SPAN><o:p></o:p> </LI></UL>
<P class=MsoNormal style="MARGIN-LEFT: 0.5in"><o:p> </o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I made
attempts to stream-line the use of extra features to ensure the speed. I
certainly may be using items that hurt instead of help. Here is the
mapfile. Now that I look at the mapfile there may be a couple items that I
originally had intended to use but are now just relics and time
wasters.</SPAN><o:p></o:p></P>
<P><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'"><<postforwebforum.map>>
</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Now
as for the users. We are assuming 5000 simultaneous - all at the same
instant. This would assume a substantially larger group of users accessing the
site at the same time. We assume this to be the peak stress for
Stage 1 of the app. </SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><BR><BR><BR><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Bruce
-</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">My
channeling sensors went off when Frank rang <g>.</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">It is
certainly true that a bit of experience and contemplation can help you discover
optimization opportunities that aren't immediately self-evident. Can you
describe the nature of your map application? Are you using raster data,
vector data, or both? What size is your data, in numbers of features
and/or files? What kind of disk subsystem is being used? Is there
layer reprojection going on?</SPAN><o:p></o:p></P>
<P><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Generalizations are
rarely helpful (except for this one). It's like being told the average man
is 5' 7" tall - it tells you nothing about how tall I am. MapServer
performance depends on a number of factors, but the best place to start is a
detailed understanding of what exactly you're trying to do with
MapServer.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">It would be
most helpful to us if you could post your map file and a sample URL request,
preferably one that is externally (publicly) visible. And can you define
what you mean by "simultaneous" users? Do you mean 5,000 map requests all
being generated at exactly the same time? Or do you mean 5,000 human users
asking for a new map every X seconds or so? And if the latter, what value
are you using for X?</SPAN><o:p></o:p></P>
<P><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
- Ed</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Ed
McNierney</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Chief Mapmaker</SPAN>
<BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Demand
Media / TopoZone.com</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">73 Princeton Street,
Suite 305</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">North Chelmsford,
MA 01863</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Phone: 978-251-4242,
Fax: 978-251-1396</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">ed@topozone.com</SPAN>
<o:p></o:p></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><o:p> </o:p></P>
<P><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">-----Original
Message-----</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">From: UMN MapServer
Users List [</SPAN><A href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">mailto:MAPSERVER-USERS@LISTS.UMN.EDU</SPAN></A><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">] On Behalf Of Frank
Warmerdam</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Sent: Wednesday,
November 07, 2007 8:26 PM</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">To:
MAPSERVER-USERS@LISTS.UMN.EDU</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Subject: Re:
[UMN_MAPSERVER-USERS] System Configuration</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Bruce Cheney
wrote:</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> We have been
given a requirement to support 5000 simultaneous users.
</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">>
What we are finding is that MapServer bogs down around 400 </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> simultaneous
users on a test machine. It looks like it is likely </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> slowing because
of the threading issue. We haven't tested on a </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> production
machine but are estimating that it should support double </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> what are test
machine could handle (double the processor and RAM). So </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> at least 800
simultaneous users. Divide that out with the 5000 and we </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> need a minimum
of 6-7 web servers supporting MapServer. We will </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> certainly scale
this as is needed but I do need some idea going in as to what is going to be
required.</SPAN> <o:p></o:p></P>
<P><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Bruce,</SPAN>
<o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I'm curious
how many map requests per minute you expect 800 simultaneous users to
generate.</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> Does
this sound like results that others expect or is this quantity </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">> above what
others have tested? Also Does anyone know of a solution in
</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">>
the works to run make mapserver thread safe and/or up the overall
</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">>
speed? I am not complaining about the speed just wondering what is in
</SPAN><BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">>
the works.</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">In various
aspects MapServer is already thread safe though there are also known "unsafe"
components, and some components are wrapped by big locks that significantly
reduce the value of multiple threads.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Progress
occurs by fits and starts, largely based on support from user organizations
depending on multi-threading. For instance, in 5.0 I implement locking
around OGR for a client of mine in Australia.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">(This is a
subtle way of suggesting you hire someone to make this happen if it is what you
want!)</SPAN> <o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">All this
aside, by default MapServer is *massively multi-threaded*.</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I say this since the
default operation is to start a new cgi instance for each request - each is
essentially an independent thread.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Of course,
the downside of whole-process cgi style multithreading is that very little
context is preserved from request to request. Map files, data file
headers, etc all need to be reparsed for each request.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">My point
here is that you need to think carefully about the application flow to take much
advantage of multiple threading within a single process.</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Also, if I
may channel Ed, if you wanted to squeeze more performance out of mapserver, you
really need to start by figuring out what it is spending it's time doing.
Where is it spending it's time?</SPAN><o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> o
waiting for disk? (perhaps you are reading more data than you
need?)</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> o rendering
(perhaps your data is overdense, or you are using expensive</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">
rendering options?)</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"> o parsing
mapfiles (perhaps you mapfile has too many unused layers?) etc.</SPAN>
<o:p></o:p></P>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Best
regards,</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">-- </SPAN><BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">---------------------------------------+--------------------------------</SPAN>
<BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">---------------------------------------+------</SPAN>
<BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">I set the
clouds in motion - turn up | Frank Warmerdam,
warmerdam@pobox.com</SPAN> <BR><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">light and sound -
activate the windows | </SPAN><A href="http://pobox.com/~warmerdam"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">http://pobox.com/~warmerdam</SPAN></A>
<BR><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">and watch
the world go round - Rush | President OSGeo, </SPAN><A
href="http://osgeo.org"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">http://osgeo.org</SPAN></A>
<o:p></o:p></P></DIV></BODY></HTML>