Changes between Version 1 and Version 2 of MapGuideRfc11
- Timestamp:
- 02/27/07 18:35:28 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc11
v1 v2 23 23 == Overview == 24 24 25 GETTILEIMAGE relies on the session repository to do its work. To improve tiled map performance and to facilitate external caching mechanisms like Squid, a new version of the operation should be introduced which does not require an MgMap object in the session repository.25 GETTILEIMAGE relies on the session repository to do its work. To improve tiled map performance and to facilitate external caching mechanisms like Squid, a new version of the operation should be introduced which does not require an !MgMap object in the session repository. 26 26 27 27 == Motivation == 28 28 29 The session repository is a key component in MapGuide Server performance. Any reduction in load on this key component will improve overall system performance. The GETTILEIMAGE request only operates on the base map layers for a particular map. This means all of the dynamic layers (buffers, redlines, etc) added to a specific user'sMgMap object in the session repository will not be involved in tile creation.29 The session repository is a key component in !MapGuide Server performance. Any reduction in load on this key component will improve overall system performance. The GETTILEIMAGE request only operates on the base map layers for a particular map. This means all of the dynamic layers (buffers, redlines, etc) added to a specific user's !MgMap object in the session repository will not be involved in tile creation. 30 30 31 As far as the tiles are concerned, only the base map layers in the original map definition are of interest. This information will be the same for all users of the map so there is no real benefit to using a unique session repository held MgMap instance for each user.31 As far as the tiles are concerned, only the base map layers in the original map definition are of interest. This information will be the same for all users of the map so there is no real benefit to using a unique session repository held !MgMap instance for each user. 32 32 33 The current GETTILEIMAGE Http op needs the session id to gain access to the session held MgMap object. This makes external cache implementations like Squid virtually impossible to use since the user's current scale is contained in theMgMap and not in the URL.33 The current GETTILEIMAGE Http op needs the session id to gain access to the session held !MgMap object. This makes external cache implementations like Squid virtually impossible to use since the user's current scale is contained in the !MgMap and not in the URL. 34 34 35 35 == Proposed Solution == … … 37 37 Implement version 2 of GETTILEIMAGE as follows: 38 38 39 {{{ 40 OPERATION=GETTILEIMAGE 41 VERSION=2.0.0 42 MAPDEFINITION=Library://NavteqNorthAmerica/Maps/nacolorTiled.MapDefinition 43 BASEMAPLAYERGROUPNAME=Base Layer Group 44 TILECOL=9079 45 TILEROW=7440 46 SCALEINDEX=1 47 }}} 39 48 40 OPERATION=GETTILEIMAGE 41 42 43 VERSION=2.0.0 44 45 46 MAPDEFINITION=Library://NavteqNorthAmerica/Maps/nacolorTiled.MapDefinition 47 48 49 BASEMAPLAYERGROUPNAME=Base Layer Group 50 51 52 TILECOL=9079 53 54 55 TILEROW=7440 56 57 58 SCALEINDEX=1 59 60 61 Most of the parameters are self explanatory. The SCALEINDEX parameter is the scale index for the tile set of interest. Tile set 0 corresponds to the most detailed scale defined in the MapDefinition. 49 Most of the parameters are self explanatory. The SCALEINDEX parameter is the scale index for the tile set of interest. Tile set 0 corresponds to the most detailed scale defined in the !MapDefinition. 62 50 63 51 … … 74 62 75 63 76 Implement a new GetTile method forMgTileService. All of the parameters are identical so there will be minimal processing required by the Web Extensions to implement the HTTP operation. This method can also be used to programmatically pregenerate tile caches.64 Implement a new !GetTile method for !MgTileService. All of the parameters are identical so there will be minimal processing required by the Web Extensions to implement the HTTP operation. This method can also be used to programmatically pregenerate tile caches. 77 65 66 {{{ 67 class MgTileService 68 { 69 virtual MgByteReader* GetTile( 70 MgResourceIdentifier* mapDefinition, 71 CREFSTRING baseMapLayerGroupName, 72 INT32 tileColumn, 73 INT32 tileRow, 74 INT32 scaleIndex) = 0; 75 } 76 }}} 78 77 79 class MgTileService 78 On the Server side, a cache of serialized !MgMap objects will be maintained to respond to the new API. These objects will be deserialized and used when a tile has to be rendered. For previously cached tiles, the !GetTile arguments are sufficient to construct a fully qualified file name so the !MgMap object will not be used. This will reduce the load on the session repository and speed up tile serving for cached tiles. 80 79 80 Two new serverconfig.ini parameters will be added to the !TileService section: 81 81 82 { 82 {{{ 83 [TileServiceProperties] 84 TiledMapCacheSize = 10 85 RenderOnly = 0 86 }}} 83 87 88 A very simple cache management scheme will be introduced. When the !TiledMapCacheSize is exceeded, all of the serialized !MgMap objects will be dumped from the cache and rebuilt as requested. If a site has a large number of tiled maps, the !TiledMapCacheSize should be set large enough to handle "typical" concurrency loads. An entry will be written to the Server logs when the cache size is exceeded to aid with tuning the cache size parameter. 84 89 85 virtual MgByteReader* GetTile( 90 If a map's tile cache is cleared or its !MapDefinition changed, the corresponding !MgMap serialized form will be removed from the cache. 86 91 87 88 MgResourceIdentifier* mapDefinition, 89 90 91 CREFSTRING baseMapLayerGroupName, 92 93 94 INT32 tileColumn, 95 96 97 INT32 tileRow, 98 99 100 INT32 scaleIndex) = 0; 101 102 103 } 104 105 On the Server side, a cache of serialized MgMap objects will be maintained to respond to the new API. These objects will be deserialized and used when a tile has to be rendered. For previously cached tiles, the GetTile arguments are sufficient to construct a fully qualified file name so the MgMap object will not be used. This will reduce the load on the session repository and speed up tile serving for cached tiles. 106 107 Two new serverconfig.ini parameters will be added to the TileService section: 108 109 110 [TileServiceProperties] 111 112 113 TiledMapCacheSize = 10 114 115 116 RenderOnly = 0 117 118 A very simple cache management scheme will be introduced. When the TiledMapCacheSize is exceeded, all of the serialized MgMap objects will be dumped from the cache and rebuilt as requested. If a site has a large number of tiled maps, the TiledMapCacheSize should be set large enough to handle "typical" concurrency loads. An entry will be written to the Server logs when the cache size is exceeded to aid with tuning the cache size parameter. 119 120 If a map's tile cache is cleared or it's MapDefinition changed, the corresponding MgMap serialized form will be removed from the cache. 121 122 The RenderOnly parameter determines whether rendered tiles are written to disk. If set to "1", tiles will not be written to the MapGuide disk cache. This can be set to facilitate use of external HTTP caches like Squid. 92 The !RenderOnly parameter determines whether rendered tiles are written to disk. If set to "1", tiles will not be written to the !MapGuide disk cache. This can be set to facilitate use of external HTTP caches like Squid. 123 93 124 94 == Implications == … … 138 108 mapframe.jsp 139 109 140 The new MgTileService:: GetTile method will need to be documented. Since the documentation is autogenerated from the header files, there should be minimal documetation impact.110 The new MgTileService::!GetTile method will need to be documented. Since the documentation is autogenerated from the header files, there should be minimal documetation impact. 141 111 142 112 == Test Plan ==