Accelerating map cache creation

It can take a long time to create an ArcGIS Server map cache that covers large scales over a broad area. This post describes some of the biggest factors that affect caching speed. You can read other more detailed considerations in Tips and Best Practices for Map Caches.

Use local file geodatabases

If you can place a copy of the source GIS datasets on the server, you’ll notice greater speed and stability during cache creation. The caching process makes thousands or even millions of requests for data, and if those requests don’t have to leave the machine, your tiles will draw more rapidly.

The ideal approach is to place an identical file geodatabase at an identical path on each GIS server machine in your cluster. Register the file geodatabase’s local folder with ArcGIS Server as a data store item. Within your map document, use local paths to the data.

Avoid projection on the fly

For the best performance, project your source data into the same coordinate system as your map to avoid projection on the fly. People naturally hesitate to put their working databases in a projection like Web Mercator. However, the data you put on the server could be a one-way replica of your production database that might only exist for the purpose of creating the cache and satisfying user queries.

Choose antialiasing levels carefully

Antialiasing is a technique that ArcGIS uses to smooth the edges of lines and labels so they don’t appear pixilated. Text antialiasing has little impact on performance, but feature antialiasing is a computationally intensive action that slows caching.

Applying at least some level of feature antialiasing can make your vector map look more professional. Just be aware that each increase in antialiasing quality can greatly extend the amount of time it takes to make a cache. The Fastest or Fast settings are good enough for most caches. Avoid the higher quality settings such as Best unless your own test caches have shown you need that level of quality.

Fully utilize your CPU without overworking it

For the fastest tile creation, your CPU should be working near 100% during the tile creation, but should not be maxed out at 100%. You can watch your system activity using tools like Windows Task Manager or Performance Monitor.

Because each map is different, achieving this level of CPU usage may require some trial and error with your cache settings. There are two major settings that affect how much server power you dedicate toward caching:

  • The maximum number of instances of the CachingTools service that are allowed to run on each machine in the cluster. A good starting value for this is n + 1, where n is the number of CPU cores in a typical machine in your cluster.
  • The maximum number of instances of CachingTools that your cache job is allowed to utilize for the cluster as a whole. A good starting value is the default you see when you run Manage Map Server Cache Tiles. This reflects the number of machines in your cluster and the maximum number of CachingTools instances each is allowed to run. If you anticipate adding other GIS server machines during the caching job, enter -1 to remove the cap on the number of instances.

The values recommended above are just a starting point for your own testing and iteration. See Allocation of server resources to caching for more details and formulas for setting these values.

Create only the tiles you need

You don’t always need to create tiles across the full extent of your map at all scales. Some tiles are visited frequently and other tiles are never visited, especially in places where data is sparse at large scales.

Before starting a cache job, carefully plan which geographies and scales you must pregenerate and which tiles could be generated on demand (or displayed with a “Data not available” tile as described here). The small scales aren’t a problem because they require relatively few tiles. It’s the large scales that require a more strategic approach.

Create a feature class to delineate the most interesting and important areas of your map. When you cache your large scales, use this feature class to constrain tile creation. A feature class with many thousands of vertices can slow down the caching tools, so you may need to generalize it first using a tool such as Simplify Polygon.

With some planning, you can avoid creating thousands of tiles outside your geography of interest or tiles devoid of features.

More tips

Finally, consider these additional tips for accelerating your caching:

  • Avoid the exploded format cache. It takes longer to generate and is more cumbersome to move around. Stay with the default compact format.
  • Sometimes antivirus software can drain resources from the cache generation, especially if the new files are being scanned at creation time. If you suspect that antivirus is competing with ArcGIS Server for memory or CPU resources, get permission from your system administrator to temporarily disable or suppress the antivirus while you build the cache.
  • If speed is more of a problem than amount of required disk space, avoid the optimized PNG format cache introduced at ArcGIS 10.1. This format is great for reducing cache size, but it can take longer to build because it must determine the optimal bit depth for each tile. Consider using the MIXED format as an alternative.
  • When you analyze your map document before publishing, fix as many of the performance warnings as possible. For example, you will see an analyzer warning if your dataset does not have a spatial index. Taking the time to build a spatial index could result in faster map service draw times and tile creation.

Contributed by Sterling Quinn of the ArcGIS for Server development team

This entry was posted in Services, Web and tagged , , , , . Bookmark the permalink.

Leave a Reply

6 Comments

  1. sibbald says:

    Sterling, Thank you for an interesting article, which I will put into practice. One question about the feature class Area of Interest, can the cache use a multipart polygon feature class, say of cities and towns as the area of interest or must a cache be run for each single part?

    Yours aye

    Jim

  2. willallender says:

    “Register the file geodatabase’s local folder with ArcGIS Server as a data store item.” I have copied the file geodatabase to

  3. willallender says:

    I want to “Use local file geodatabases” for cache creation, on 9 servers in the Site. I just spent the last hour on the phone with esri tech support, and together, we could not figure out how to do it. Do you have a link to more detailed steps? The only way we could get it to work (kind of) is to create a shared folder from the publishing server, and identify that as the data store. However, this means that all 9 servers are hitting this folder for data, as opposed to hitting data stored locally on each.

  4. gprocino says:

    Deal all,
    I created cache using ArcMap instead of ArcGIS Server because it works more rapdly.

    Now, I would like update cache using ArcMap. The tools “Manage Map Server Cache Tiles” required a AGS Service. Is there a similar tool for update cache by ArcMap only?

    Regards
    Giuseppe

    • ArcGIS for Server Development Team says:

      @gprocino When you create a map cache in Desktop, the tiles are created as part of a map service residing on ArcGIS Server. No local cache is created in Desktop; therefore, the tool asks for the cached map service containing the tiles to be updated. To learn more about how to use the Manage Map Server Cache Tiles tool, see:
      http://resources.arcgis.com/en/help/main/10.2/index.html#//00540000000p000000

      • procino says:

        @ArcGIS for Server Development Team
        Dear support,
        I try to describe my question again with more details.
        I created local cache using ArcMap (10.1) instead of ArcGIS Server using the following procedure:
        - In ArcCatalog right cilck on my mosaic dataset.
        - Generate tile cache

        With “Generate tile cache” command I set a local directory as output directory. With “Generate tile cache” the builder of cache is ArcMap only. After the cache was created I moved it on ArcGIS Server Cache and it worked fine.

        Now, I would like update cache using only ArcMAP as above but with “Generate tile cache” I can’t using aoi (zone of cache that I would like update) feature class to update and in “Manage Map Server Cache Tiles” I can’t specify a local folder of my cache (but only a mapservice).

        Is there a tool for update cache by ArcMap only (without ArcGIS Server) when I can specify the local folder of cache and the zone to update?

        I’m using ArcGIS 10.1 product family with all sp.

        Regards
        Giuseppe