ArcGIS Server Best Practices and Guidelines NEARC 2007 ESRI Technical Session ESRI, Boston
Agenda Components and Deployment OS User Groups and Directory Configuration Service Architectures GIS Security Administration Tools and Map Service Creation Demo: Map publishing, securing services Best Practices for Dynamic Map Services Best Practices for 2D Cached Map Services Demo: Update Map Server Cache By Feature Class and "Data Not Available Geoprocessing Services Demo Monitoring AGS Performance ArcGIS Online Demo AGS Development Kit Demo: Accessing GIS Web Services Demo: programatic customization of the web application Further Resources Questions and comments
ArcGIS Server 9.2 Complete & Integrated server-based GIS Out-of of-the-box applications and services Tremendous developer opportunities Spatial Data Management ArcGIS Desktop Java Visualization (Mapping) ArcGIS Explorer.NET ArcGIS Server Spatial Analysis Web Mapping Applications ArcGIS Mobile
ArcGIS Server Component Stack ArcGIS Server Web Tier Server Object Manager Server Object Container ArcSDE
ArcGIS Server 9.2: Deployments Web Tier SOM Web Tier SOM DBMS Web Tier SOM SOC ArcSDE SOC ArcSDE SOC ArcSDE DBMS DBMS Single Machine Scenario Multiple Machine Scenario
Distributed Installs
Distributed Installs: The following topics in the online help provide complete instructions tions for a distributed install: How the GIS Server Works Configuring a Distributed Installation of ArcGIS Server The online help can be found at the following URLs: http://webhelp.esri.com/arcgisserver/9.2/dotnet http://webhelp.esri.com/arcgisserver/9.2/java
Distributed Installs: Highlights Determine which ArcGIS Server Components to scale to additional machines Run the required post-installs Add required OS users and groups Configure required server directories
Guidelines for Configuring ArcGIS Server Components SOM Machines Server Object Manager Manages the services distributed across one or more SOC machines Background process (ArcSOM.exe) Handles load of incoming requests ArcSOM.exe process uses relatively little memory Does not need to run on a dedicated machine Can coexist with the web server or reside on SOC machine
Guidelines for Configuring ArcGIS Server Components SOC Machines Server Object Container Host services Process requests Work center of the GIS Server Processes started and stopped by the SOM Processes run under SOC Account Need same name and pwd on each SOC machine Needs access to data and servers Post install process can create account Launch container permissions Temp directory permissions Insufficient permissions of SOC Account is a common cause of GIS Server issues!
Distributed Installs: Required OS Users and Groups
Distributed Installs: Required Directory Configuration
Service Architecture
Pooled Service Model State information (e.g., Current extent, layer visibility, etc.) maintained in web server / browser Scales better due to shared object pool
Non-Pooled Service Model Typically holds its reference to the service for the duration of the application's session Number of users on the system can have no more than a 1:1 correlation with the number of running service instances
Scaling Out Adding More Computing Power
Setting Capacity Limits number of service instances running on a specific host machine. Once this limit is reached, Server starts replacing least recently used instances instead of creating new ones. Serve large number of services only part of which are used at any point in time Usage sliding from European to U.S. map services over time. Supports limited resource scenario Serving a large library of maps Individual services rarely used
Using failover or round-robin robin configuration SOM could be single point of failure Can set up multiple SOMs Configure datasources to access additional ArcGIS Servers for: Round-robin Failover Design time or programmatic
How GIS Security Works AGS local vs. AGS Internet Local connections: operating system, agsusers, Internet connections: web server administered security Identify who can access the server Users, administrators
Local connections from ArcGIS Desktop A desktop client application to ArcGIS Server will run as the user account that started the application In Windows, you can use the runas command to connect to ArcCatalog with an operating system account other than your current login
Local connections from Web applications The account that you use for the identity must belong to the agsadmin or agsusers group on each local server to which your application will connect. When end users access the application, they will not have to enter er a name and password to access the service.
Securing ArcGIS Web services ArcGIS Web services are an ASP.NET application Each service has its unique URL http://<myserver>/ >/arcgis/services/< /services/<myservice>/ >/MapServer Use standard approach for ASP.NET security Require authentication Disable anonymous access in IIS Manager Uses Windows authentication Can t have a form login for a Web service Windows accounts in agsusers/agsadmin Authorize services or folders Use ASP.NET <location> tags in web.config ArcGIS Server Help http://webhelp.esri.com/arcgisserver/9.2/dotnet/ manager/administration/secure_web_svcs.htmsecure_web_svcs.htm <location path="secureservices"> <system.web> <authorization> <allow roles= SecureUsers" /> <deny users="*" /> </authorization> </system.web> </location>
Administration Tools and Map Service Creation
Managing ArcGIS Server Traditional Method: ArcCatalog Create, Start, Stop Services Edit service properties GP tools for caching New Method: Server Manager Web Based Interface Administer ArcGIS Server
Publishing Geographic Information Server Manager Web Based Interface Publishes Services Creates Template-Style Web Applications ArcCatalog Publish Services ArcCatalog Manager
ArcGIS Web Mapping Application A Browser-based GIS Application Included with ArcGIS Server Supporting Mapping Editing Geoprocessing Routing Geocoding Data Management Web Map High Quality Fast Dynamic Navigation AJAX Integrates Multiple Service... Easy Access to GIS
Demo Map Publishing Securing Services
Best Practices for Dynamic Map Services
Optimize Your Map Services Maps can include both dynamic as well as static layers Dynamic Layers = rapidly changing data Roads symbolized by current snow depth Electrical network showing the latest posted work order Static Layers = more slowly changing data Landuse / Landcover Road Network Basemap data The classification is subjective / application specific
General Guidelines Show relevant information Start simple (additional layers can be toggled on by user) Use field visibility (hide unnecessary attributes) Use scale dependencies Use data appropriate for the given scale (generalize if necessary) Display similar number of features at all scales for consistent user experience Simplify attribute data http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?topicname= webhelp.esri.com/arcgisdesktop/9.2/index.cfm?topicname=presenting_attribute_data_in_interactive_maps
General Guidelines Use SDE when possible When using file based data, copy locally to each SOC machine Be aware of projections Remove unused layers and data frames Use definition queries Index attributes to be queried
Point, Line & Polygon rendering Points Use single layer Simple or Character markers for best performance Use EMF instead of bitmaps Use Integer (vs. character) fields for symbol values Avoid halos, complex shapes, masking Line & Polygons Use ESRI_Optimized style Avoid cartographic lines (also includes polygon outline!)
ESRI_Optimized Lines and Polygons Outlines for all fills are simple lines instead of cartographic lines Picture fills are EMF-based instead of BMP-based Improves drawing performance by > 50% http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?id=305&pid=297&topicname=creating_fill_symbols97&topicname=creating_fill_symbols
Text and Labeling Use annotation instead of labels Use indexed fields (reduce label SQL query number and complexity when possible) Use label and feature conflict weights sparingly Avoid special effects (fill patterns, halos, callouts, backgrounds) Avoid very large text size (60+ pts) Avoid Maplex for dynamic labeling Avoid overuse
Mobile Map Authoring Guidelines Contrast and Simplicity Resolution\scale scale dependency Rasterized marker symbols\simple simple line and polygon symbols
Best Practices for 2D Cached Map Services
2D Map Cache overview ArcGIS Server map services can now use an image cache to significantly improve performance while delivering maps. A map service that fulfills requests with pre-created tiles from a cache instead of dynamically rendering part of the map is called a cached map service. Clients can still access the underlying data of the cached map services Identify, Query, Highlight feature geometry
Cached Map Service Tiles pre-rendered rendered at fixed scales Rapid display of static base maps Richer symbols and more information
Classic Dynamic Mapping Trade-Off Quality vs. Speed Shaded Relief Transparent Layers Maplex Labeling Low-res relief Solid colors Annotation
The cached images are stored on disk
Cache Directory Hierarchy
Designing and authoring a map cache Anti-aliasing Smoothes the edges of labels and lines by blending them with the background. The resulting screen display quality can be better than standard rendering in ArcMap. Tiles are rendered at finer resolution by down sampling (takes twice t as long to cache an area when using anti-aliasing) aliasing) Be cognizant of the client application (especially when building a service that is meant to be used as an overlay service)
Generating the map cache The caching process can be a very time consuming process. Before initiating the cache building process for the entire map service, build it for a small area to test the output symbology, labeling, and the performance criteria in your primary map client. Configure map services to use as many instances as possible to be available for cache generation processing
General Guidelines for overlaying cached map services Coordinate System of Maps fastest performance when your cached maps are in the same coordinate system Tile origin and tile sizes need to be the same Scale levels should be identical whenever possible Setting the Primary Map Resource in your Web application determines which service will supply the coordinate system and zoom levels of the map
Tile Image Types Use JPEG if Speed is More important than Transparency PNG8 a lossless, 8-bit color, image format that uses an indexed color palette Transparency is stored in the color index palette, excellent browser support PNG24 a lossless, three-channel image format that supports large color variations (16 million colors) and has limited support for transparency. Transparency value is stored in the image header. Versions of Internet Explorer less than version 7 do not support this type of transparency. rency. PNG32 a lossless, four-channel image format that supports large color variations (16 million colors) and transparency. JPEG a lossy, three-channel image format that supports large color variations (16 million colors) but does not support transparency.
How Many SOC Instances for Caching? Cache generation runs as a batch process and for the most part consumes a CPU. Good practice is to use an N+1 approach where number of SOC processes should equate to the number of available CPU cores, plus one more. The additional SOC will consume any left-over CPU cycles while busy SOCs are waiting on data. Too many SOCs will cause resource competition.
Cache map scales Simple tiling scheme: determine the closest scale Double scale factor until you reach scale that encompasses entire AOI
How big will the cache be? http://arcscripts.esri.com/details.asp?dbid arcscripts.esri.com/details.asp?dbid=15045
Caching partial extents Update Map Server Cache by FeatureClass http://arcscripts.esri.com/details.asp?dbid=15161
Demo: Caching
Demonstration: Update Map Server Cache By Feature Class to cache a very specific area Create Fishnet GP tool Select By Location to select the polygon indexes that intersect AOI export these selected index polygons to a shapefile create "dummy" cache with the target scales generate the cache at the target extent run the Update Map Server Cache by FeatureClass script using the selected index polygon shapefile as the feature class
Demonstration: Data Not Available Tile Handler Use Web Server to handle custom HTTP 404 Error Return URL to data not available image Image should be same dimension and type of cache http://blogs.esri.com/dev/blogs/arcgisserver/archive/2007/04/12/configuring-your-server-to-displaya-_2200_data-not-available_2200_-tile-for-empty-map-cache-areas.aspx
Geoprocessing Services Guidelines Publishing Tool Layers vs. Tool Boxes Synchronous vs. Asynchronous Access to data %ScratchWorkspace% Demo
ArcGIS Server Performance
Monitoring Performance ArcGIS Server Logs Server Statistics Web Server Logs Web stress testing software http://www.esri.com/systemsint/kbase/docs/stress-test-methodology.pdf HTTP communication monitoring Fiddler: http://msdn2.microsoft.com/en-us/library/bb250446.aspx
Monitor Statistics and Log Files Creation Time Amount of time to start the service (load the MXD, etc.)
Monitor Statistics and Log Files Wait Time Amount of time a client waits to get access to a service instance (SOM queue time) Wait time is one of the more interesting statistics, because it is a measure of how fast a client application feels.
Monitor Statistics and Log Files Usage Time Start to finish time for service instance use (service processing time)
Monitor Statistics and Log Files ArcGIS Server Manager Logs C:\Program Files\ArcGIS\server\user\log
Monitor HTTP Conversation Microsoft s s Fiddler HTTP debugging proxy http://www.fiddlertool.com/
ArcGIS Online
ArcGIS Online Services Demo: AGSOnline_Viewer
Tip: Create a map cache with level of detail scales used by ArcGIS Online http://blogs.esri.com/dev/blogs/arcgisserver/archive/2007/07/20/how-to-build-a-cache-with-the- same-tile-sizes-and-scales-as-arcgis-online.aspx
ArcGIS Server 9.2: Software Development Kit Build and deploy web & enterprise geospatial applications and services Productivity boost with out-of of-the-box IDE integration Software Development Kit (SDK) includes :.NET components Web ADF Mobile ADF Java components Web ADF Enterprise ADF WebMap Applications ArcGIS Mobile Business Applications Integration Environment Web Mobile.NET Web Enterprise Java Software Development Kit (SDK)
Web Access of GIS Resources Allows any SOAP Webservice client to call published GIS resources directly client does not need ArcGIS or ArcObjects Endpoints generated by ArcGIS Server automatically
Demo: Accessing GIS Web Services
Demo: Adding Custom Floating Panels and Tasks to Web Mapping Applications ions Explore the Callback Framework http://serverx.esri.com/esriblogs/blogs/arcgisserver/archive/2006/12/18/using-the-callback-control-framework.aspx
ESRI Systems Integration Services http://www.esri.com/systemsint www.esri.com/systemsint/
ESRI Educational Solutions for Authoring and Publishing Map Services with ArcGIS Server Danvers 12/17 (VBA) Danvers 1/3, 3/3 Hartford 2/12 Danvers 3/5 (.NET) Johnstown 1/8 (Java) *Additional training locations and dates at http://training.esri.com 2007 ESRI NEARC 71