Optimizing Performance
For a given level of hardware speed and capacity, performance for a Manifold
map server page depends upon Windows system settings (including IIS settings) as
well as the configuration of the map server and the .map file it uses.
The map server uses Manifold to generate images served via the web page. The
basic performance of the map server will be similar to that of Manifold during
interactive usage and is subject to the same optimization tips suggested for
Manifold in the Performance Tips topic. Make sure you follow all the performance tips listed in that topic.
Additional performance tips of special interest to IMS:
Map Server Performance Tips
- Export smaller sized web pages - Generating a map server image of 400 x 300 requires less computation than an image of 800 x 600. Larger views will usually include more objects and so require greater
display computation. In addition, serving larger images means moving larger
amounts of pixels into the created image and then transmitting those larger numbers
of pixels down the Internet pipes connecting the server to the user's browser.
- Avoid use of very large .map files - The larger and more complex the component the slower will be the response
of the map server. Just as with interactive use of Manifold, performance of the
map server will improve as the user zooms in so that fewer objects participate
in the display.
- Avoid unnecessary use of images and surfaces - Images and surfaces are much slower than drawings for the information they
provide. The Manifold map server will happily serve images and surfaces but
these should not be used as casual substitutions for drawings when a drawing will
do as well and will provide higher performance.
- Install adequate RAM - As components in the .map file are used, they are read off disk and brought into RAM. Once a
component is in RAM, it stays there unless the RAM must be freed for some other
purpose. The map server can work faster if the components it needs are already in
RAM. As the parts of the .map that are served are brought into RAM and stay there (as a result of normal
Windows RAM caching) access speed will increase. This only works, of course, if
there is enough RAM so that the cached .map data is not flushed from RAM because some other Windows application needs the
RAM.
- Eliminate initial load lag - The first time a very large map is served the map server will be slow to
respond while the .map is opened and loaded for the first time. After creating a site the webmaster
should browse the site and choose Zoom to Fit with all layers turned on. This will load the entire .map file into RAM. Thereafter, server response will be faster.
- Match component projections to maps - If a map is served, all layers in that map should have exactly the same
native projection as used by the map. This will eliminate any need to re-project
on the fly. This is especially important for images and surfaces.
- Delete unused components from the .map file - If the .map file contains many components other than those published in the web page the
map server will respond slightly more slowly than if the .map file contained only those components being published. Delete any unused
components from the .map file. This is normally a very minor impediment to maximum performance.
However, if the .map file contains very large components that are not used the performance
difference may be noticeable.
- Delete unused data from components - If the web site does not enable the Find tool or use queries there is no point in publishing a drawing that contains
data attributes. Delete the columns in the drawing's table. When publishing
maps that contain more than one drawing the Find tool will list all fields in all drawings in the map. Delete all fields that
you do not want users to be able to employ in Find. This will reduce the size of the .map file.
- Avoid use of unnecessarily detailed data - A web site that provides overall, national data should not use extremely
detailed high-resolution drawings. Use Normalize Topology with appropriate Location Precision settings to simplify drawings. This is often a key step to increasing the
speed of redisplay, pan, zoom, etc.
- Use Zoom Ranges to present the level of detail required - Suppose we would like to show a national map for user orientation when
zoomed out but we would also like to show very detailed shorelines when users zoom
in. Create a map using two drawings: a highly detailed drawing plus a second,
low resolution drawing created from the first by generalizing with Normalize Topology to a lower Location Precision value. Assign zoom ranges to the drawings so that the low-resolution drawing is the only drawing
displayed when zoomed out and the high-resolution drawing is the only drawing
displayed when zoomed in. When users browse the map in a zoomed out view the display
will be fast because a fewer number of coordinates need be used to display the
low-resolution drawing. When users are zoomed in the high-resolution drawing
will become visible; however, only a portion of the high-resolution drawing will
be seen in a zoomed in view so the display will still be fast.
- Store the .map file used on a fast, local hard disk - When the Manifold map server operates it accesses the .map file that was used with File - Export - Web Page to create the web page. If the .map file is located on a slow hard disk or on a different machine that must be
accessed via a local area network then performance will not be as fast as if the .map file was immediately available on a local, fast hard disk.
- Avoid using intrinsic fields in queries. For example, if the length of a road line must be used, do not
compute the length on the fly via the Length (I) intrinsic field. Instead, create a new column called Length and copy the contents of the Length (I) intrinsic field into this new column using the transform toolbar Copy command. When an intrinsic field is used in a query a small computation must
be performed for every record for every query. If the intrinsic field is
copied to a regular column the computation is done only once. The query can then
use the regular column for faster operation.
- Very Important: If you create a default_admin.asp page for your IMS site, make sure to change access permissions on it so that ordinary Internet browsers cannot
use it. To do this, in Windows Explorer right click on the default_admin.asp file, choose Properties and choose the Security tab. Remove all entries for allowed user names except Administrator or whatever other login name you wish to allow access to the administration
page. Apply the settings and press OK. Neglecting this important step will not create a security breach in that
hackers will be able to steal your data, but it will allow a malevolent user to
effectively shut down your map server by repeatedly causing it to Reload .map files.
IIS Configuration Performance Tips
- Create an application and consider using High (isolated). - Create an application on the directory in which the web page is located
and run it with high isolation. This runs the map server process as an isolated
process outside of the IIS process and separate from any other applications
running on IIS. This helps performance slightly (albeit at the cost of creating
temporary files for every user), and also isolates the application so any errors
in the scripts or map server application won't bring down IIS or any other
application. For performance reasons, don't run more than ten IIS applications as High (Isolated). To run additional map server applications beyond ten, if the map server
application is well debugged (that is, the scripts used in default.asp and other files are well debugged), use Medium (pooled) for the additional applications. Medium pooling might also be a good idea to
reduce the creation of per-user temp files (see comments below).
- Don't enable session state - Within the IIS manager, in Properties - Configuration - App Options uncheck Enable session state. The Manifold map server does not use sessions so this can be unchecked if
desired to eliminate the overhead of maintaining session state. In the same
dialog it is a good idea to also uncheck Enable parent paths if desired. This has no impact on performance but it does improve security.
Unchecking this box means the application can not refer to anything in higher
directories. The map server application itself only refers to files within its
own directory or subdirectories such as the images folder.
- Enable object pooling - If there are more than about 10 simultaneous users, enable object pooling.
This is done in the Control Panel - Administrative Tools - Component Services manager. Drill down into COM+ Applications and find your map server application. Drill down into Components for that application and right click on the component there and choose Properties. Object pooling settings are on the Activation tab. Check the Enable object pooling box. The pooling parameters may be left on default settings.
System Configuration Performance Tips
- Store the .map file used on a fast, local hard disk - When the Manifold map server operates it accesses the .map file that was used with File - Export - Web Page to create the web page. If the .map file is located on a slow hard disk or on a different machine that must be
accessed via a local area network then performance will not be as fast as if the .map file was immediately available on a local, fast hard disk.
- Install lots of RAM - Installing plenty of dynamic RAM is often the most efficient way to enable
a server to serve more users faster. RAM is now so inexpensive (under $40 for
a gigabyte) that it makes sense even for a hobbyist to install two or three
gigabytes of RAM. If you are running an older motherboard that can hold only
one and a half gigabytes, fill it up with the maximum amount of RAM right away it
even if you don't feel you need it because eventually memory for older
motherboards will be difficult to get.
- Use a fast processor - A faster processor will be able to serve more users. Upgrade to a
gigahertz class processor.
- Use Windows Server 2003 or XP - Windows Server 2003 provides the best performance. Windows XP provides
slightly better performance than Windows 2000. Do not use Windows NT or 16 bit
Windows releases such as Windows Me or 98.
About IIS Applications
An IIS application is any file that is executed within a defined set of
directories in a web site. Creating an application designates a particular directory
in the web site as the starting point directory (also referred to as the application root). All files and directories under that starting point directory are
considered part of that application until another starting point directory is
encountered. See the About Applications topic in the IIS documentation.
Different components from the same .map file can be used with different map server pages. However, all map server
pages must be part of the same Application.
About Object Pooling
Manifold components support object pooling, which avoids the overhead of
creating new objects in highly loaded servers. Normally, when a process needs an
object it is created on the fly using the component's class factory to create a
new object. When object pooling is turned on objects that are created are
retained in a pre-built pool of objects. When an object is needed an object from
the pool is activated if one is available. Pooled objects are returned to the
pool when no longer needed.
Suppose 20 users at once hit the web site. The first time the server
experiences this peak load enough objects to service the 20 users will be created. As
load drops, objects will be returned to the object pool. Thereafter as long
as the load stays under 20 simultaneous users no objects need to be created:
they will simply be activated from the pool. If load grows again and peaks at 25
users, a few more additional objects will be created since the objects in the
pool will not be enough to service demand. Thereafter, enough objects will be
in the pool to serve up to 25 simultaneous requests.
Logging
Manifold IMS supports logging. To enable logging, edit the config.txt file for a page and add the following line:
logfile c:\mapserver.log
where "c:\mapserver.log" is the fully qualified path name to the desired log file. The log file
will be written in CSV format using field names that are self-describing. ticks is the number of 1/1000ths of a second spent serving the image. It's safe to
use the same log file for different instances of the map server.
Be careful when enabling logging. It is always easy to turn on a logging
function and then forget it has been enabled until the log file grows to a huge
size.
Security Tips
Microsoft IIS is a secure and highly reliable web server when correctly
configured by the system administrator. Nonetheless, the many options made available
within IIS to support the needs of experts can result in security problems if
administered improperly. Because an IIS web server connected to Internet can
be attacked by any Internet user from anywhere in the world, a few general IIS
security measures should be applied to any web server connected to the Internet.
These measures are not specific to Manifold IMS: they should be applied to every web server.
We recommend the following elementary steps:
- Very Important: If you create a default_admin.asp page for your IMS site, make sure to change access permissions on it so that ordinary Internet browsers cannot
use it. To do this, in Windows Explorer right click on the default_admin.asp file, choose Properties and choose the Security tab. Remove all entries for allowed user names except Administrator or whatever other login name you wish to allow access to the administration
page. Apply the settings and press OK. Neglecting this important step will not create a security breach in that
hackers will be able to steal your data, but it will allow a malevolent user to
effectively shut down your map server by repeatedly causing it to Reload .map files.
- Use Windows Server 2003, XP or 2000.
- Do not allow anyone to work interactively, to read mail or to browse web sites
on the machine that hosts your web site. If you must use the same machine
interactively, make sure that users do not have Administrator privileges. If a user with Administrator privileges just
once opens a malevolent email attachment the web server itself could be
infected with a wide variety of "backdoor" viruses or Trojan Horse attacks. Never
read email or browse the web when logged in as Administrator.
- Install the latest Service Pack for Windows. Service packs include many
security patches.
- Install any supplemental security patches published by Microsoft after the
last Windows Service Pack. Microsoft now has tools that can scan your system to
determine if there are security patches published that have not yet been
installed. Visit Microsoft TechNet at http://www.microsoft.com/technet/default.asp and drill down to their Security pages for information on the latest security
tools and patches.
- Install anti-virus software. Keep your anti-virus software updated with
regular downloads from your vendor.
- Install Microsoft URLScan (a free download from Microsoft TechNet) or similar tool. URLScan is a ISAPI
filtering tool for IIS that rejects a wide variety of malformed URL requests
before they can hit IIS. It is very easy to use. It was published by Microsoft
in 2001 and is an absolutely essential tool to prevent many different types of
Denial of Service attacks. No doubt the functions provided by URLScan will
continue to be offered by Microsoft either as independent tools or built into IIS.
Manifold IMS works perfectly with URLScan.
- Apply Microsoft's IIS Lockdown Tool (a free download from Microsoft TechNet) using Advanced Lockdown. Uncheck the box that disables support for Active Server Pages (.asp) and otherwise accept all of the defaults suggested by Advanced Lockdown.
Manifold IMS works perfectly with Advanced Lockdown settings so long as Active
Server Pages are still enabled. This tool is also very easy to use.
- Do not run unnecessary services. If your server runs a web site only, do not
install or enable additional services such as FTP, NNTP or others. If such
services are already installed, use Internet Services Manager to stop them. Do not install any accessory software or Windows components that are
not required.
- Learn to use Advanced TCP/IP settings for the Internet Protocol in your
Network properties for your network card. If your web site is intended only for
specific machines (such as those on an Intranet), use IP security to deny access to any unauthorized machines (IP addresses). If you are
connected to Internet, use TCP/IP filtering to permit only those TCP ports absolutely required to service your web site
(typically, port 80 for HTTP and port 443 for HTTPS).
- If you can afford it, install a firewall and learn to use it. Use a hardware firewall and/or software solution such
as Microsoft's Internet Security and Acceleration Server. Hardware firewalls
now cost well under $200.
- Install the latest updates for Manifold System from manifold.net.
- Get a good book on Windows and IIS security. Read it carefully and apply the
recommendations.
Very important: Although Manifold IMS can work with Microsoft security tools
for IIS such as URLScan and the IIS Lockdown Tool, it is possible that other IIS
applications installed on your system cannot work with these tools or require
modifications to the default settings of these tools. It is critically
important to read the documentation for these security tools.
Minimizing Per-User Temp Files
When using a High isolation level in IIS, a new process will be created for
each user accessing IMS. When this is done the multiple instances of IMS can not
share data with each other and will be forced to create a separate set of
temporary files for each user. This provides high isolation but results in a large
number of temporary files in the system TEMP folder.
One way of reducing the number of temporary files created is to lower the
isolation level applied to the web application that uses IMS so that multiple
instances of IMS can operate in the same process. This does create a risk in that a
crash of one instance of IMS will likely crash all other instances, but given
that it is relatively difficult to crash IMS in the first place, this might be a
good tradeoff in the case of well-debugged .asp files.
Troubleshooting
See the troubleshooting topic Problems with the Internet Map Server for detailed checklists of what might be wrong.
See Also
Map Server Overview
Creating a Web Site
IMS Queries
Publishing Multiple Pages
Problems with the Internet Map Server
Back to Manifold Home Page