How To: Generate map caches on Solaris or Linux


ArcGIS map services now have the capability of using a cache to dramatically improve performance while delivering maps. A map service that services map requests with tiles in a cache instead of dynamically rendering part of the map is called a cached map service. The map cache is a directory that contains image tiles of a map extent at specific scale levels. ArcGIS Desktop and Server Web ADF applications use cached map services to request tiles from virtual directories containing the tile cache. A cached map service cache is created and managed by ArcCatalog, but can also be created using scriptable GP tools.

For the Solaris and Linux versions of ArcGIS Server for the Java Platform, the 'generatemapcache' script can be executed from the command line to create map caches for MapServices that are already running in ArcGIS Server. This tool is located in the $ARCGISHOME/java/tools directory. Instructions provided describe basic guidelines for successfully creating a map cache using generatemapcache.sh.

The ArcGIS Server Object Container (SOC) process runs as the ArcGIS Server user. By default, this user is not a member of agsadmin group.

Only members of the agsadmin group can create empty contexts on the Server, and successfully run the generatemapcache/generateglobecache tools.


The ArcGIS Server user needs to be added with the group agsadmin. Use the following steps to accomplish this in Manager:

  1. Log into ArcGIS Manager.
  2. Click on GIS Server tab.
  3. Click on Users link on the left side.
  4. Click Add Users.
  5. Designate the username as 'ags' and the Group as 'agsadmin' (Assuming “ags” is the selected arcgis server user).
  6. Click Save.

    Now, run the generatemapcache script to create the cache:

    A. In a command window, change the current working directory to $ARCGISHOME/java/tools.

    B. At the command line, type './generatemapcache.sh' (no quotes).

    C. When prompted to run on the Engine or Server context, select the option for 'Server'.

    The Engine option runs the Geoprocessing tool that generates the cache in-proc (i.e. in the same process). It requires the <arcgisserverhome>/servercore/.Server/init_server.sh script to have been previously sourced to correctly set up the environment for it. It also requires an X Window session.

    The Server option first connects to the named server using the credentials provided, and runs the Geoprocessing tool in an empty context on the server. This mode does not require an X Window session.

    D. Follow the directions as the script runs through the cache generation process.

    When the process is finished, the output is located in $ARCGISHOME/server/serverdir/arcgiscache.
    In some cases, it may be necessary to increase the amount of time the server needs to keep the SOC alive and available. This is important in cases where the caching process might take an extremely long time to complete. To increase the time-out, edit the $ARCGISHOME/server/system/Server.dat file on the server by changing the value of <EngineContextTimeout> to a large number, such as 36000 seconds.