Configuring multi-process in single machine

Feedback


Single process could not make the best of CPU and memory of the system, GIS has the high standard requirement to the performance because of huge amount of data, high density of computing and so on, so it need parallel computing and multi process strongly. In the past, we used configuring single machine cluster to realize starting multi iServer to serve in one system, to take fully advantage of system resources. It needed to modify the port NO. manually and so on, and it was complex.

Now, iServer provides visualized single machine multi process configuration to assist you to create multi iServer process quickly in one OS. you only need to start multi-process, iServer will create and start multi process by the process NO. you assigned automatically. and, through multi process structure of iServer, you could deploy service that every data matched in the independent worker, to isolate different service between processes.

Multi process sturcture

There is a Master and multi Worker in iServer multi process structure, and a Daemon role to monitor Master to avoid it failes.

Configuring and using multi-process

Starting multi-process

Starting multi-process means: iServer changes from single process into multi process in the OS, and disabling multi process means: multi becomes single.

You could refer below steps to configurate and start multi-process in PC.

  1. Visiting iServer service management, click service, advance, multi-process configuration by order.
  2. In the multi-process configuration page, check "if starting in the multi-process mode", it will configurate by your system (we recommend Worker NO. is the same as CPU cores NO., to perform best), default is 2.
  3. Set the Java virtual machine memory. The default is 1024M
  4. Set the communication port number between the master process and the child process to avoid conflicts with other ports. After modifying, you need to restart iServer to make it go into effect.
  5. Set connection timeout between the master node and child node. The unit is milliseconds.
  6. Set port range of Worker process by your network condition, default is from 8900- 9000, Work port will increase from 8900.
  7. Click save configuration, iServer will start multi-Worker automatically by the configuration above, at the same time, it pops the dialogue which displays that multi-process is starting, after created, this dialogue will disappear.
  8. Restart iServer, to effect multi-process configuration.
  9. After starting service, visit "service" and "multi-process" page in service management, you could check every Worker which started already, including all Worker port and service automatically deployed.
  10. Click all service hyperlink in the service list, you could visit and use these service directly, you also could check and visit service in the "service list" page of master.

Note: in the multi-process configuration page, after starting or disabling multi-process, it will work after you restarting iServer.

Adding or reducing child node dynamically

iServer multi-process node NO. supports dynamic stretching, you could add or reduce node by the system condition or demanding of usage.

The method to add or reduce child node:

  1. Login on server management of iServer main node Master, click service, advance, multi-process configuration by order.
  2. In the multi-process configuration page, set NO. of Worker, it could be biger or smaller than before.
  3. Reset the port range of the Worker process as needed.
  4. After click save configuration, iServer will dynamically adjust every Worker by your configuration, including updating port and deployed GIS service.
  5. If the port range of Worker is changed, please restart iServer to effect above configuration.

After finishing modification above, you could check the running Worker child node in the multi-process page.

Managing multi-process GIS service

After starting multi-process, original iServer becomes the iServer Master node of the multi process, Master deploys the original iServer GIS server automatically in the newly added Worker node, Master main node uni-manages Worker, including service management, safety management, service monitor, visiting count, log checking and so on of all Worker, which means you could uni-manage all GIS service of worker. you could:

Anyway, after starting multi-process, although it starts multi-iServer process automatically, while you need not to manage every single iServer, you only need uni-manage all service in Worker by Master node of original port like before you manage single iServer.

Configuring multiple service instances

For services with high resource consumption, configuring multiple service instances can effectively improve resource utilization and service access efficiency. iServer supports multiple service instances. You can dynamically set the number of service instances, that is, assigning the number of Workers for the service. For example, if the number you set is n, then the service will be assigned to n workers, and the requests for the service will be processed by these Workers. You can configure multi-instance in the following ways:

Configuring multi-instance through iServer WebManager

When publishing workspace into GIS service, you can enable multi-instance in the following way:

When publishing other sources of GIS services, the services will be automatically published as multi-instance by default. You also can modify the number of instances in the following way:

Configuring multi-instance through XML file

If you configure the service instances through XML file, you need to add an parameter to enable multi-instance in the service provider configuration file, and set the number of instances in the service component configuration file. The specific steps are as following:

    <provider class="com.supermap.services.providers.UGCMapProvider"  enabled="true" name="map-World"> 
      <config class="com.supermap.services.providers.UGCMapProviderSetting"> 
         <workspacePath>E:/supermap_iserver_801_4/samples/data/World/World.sxwu</workspacePath> 
          <multiThread>true</multiThread> 
          <poolSize>0</poolSize> 
          <ugcMapSettings/> 
          <useCompactCache>false</useCompactCache> 
          <extractCacheToFile>true</extractCacheToFile> 
          <queryExpectCount>1000</queryExpectCount> 
          <ignoreHashcodeWhenUseCache>false</ignoreHashcodeWhenUseCache> 
          <cacheDisabled>false</cacheDisabled> 
          <isMultiInstance>true</isMultiInstance> 
       </config> 
    </provider>  
    <component class="com.supermap.services.components.impl.MapImpl"  enabled="true" instanceCount="3" interfaceNames="rest" 
 name="map-World" providers="map-World"> 
      <config class="com.supermap.services.components.MapConfig"> 
          <useCache>true</useCache> 
          <useUTFGridCache>true</useUTFGridCache> 
          <useVectorTileCache>true</useVectorTileCache> 
          <expired>0</expired> 
          <cacheReadOnly>false</cacheReadOnly> 
      </config> 
    </component> 

After the setting, you can view the service instances on the "Multi Process" page. In addition, if the instanceCount you set is greater than the number of Workers, the system will use the number of Workers by default, that is, the service will be assigned to all the Workers.

Application scene

With the development of the hardware tech, almost all computers are multi-core, so we could use multi-process feature of iServer to improve resource utilization rate. In detail, it could take multi-process advantage in the scene below:

It could isolate different data service by using multi-process when data source is various, because iServer will deploy data which come from the same work space in the same Worker when classifying service.

After iServer starts the multi-process, all the Worker node could take part in the distributed map cutting as the map cutting node automatically, so it improves the efficiency of map cutting by single machine.

In terms of data push, when distributed tiling by traditional methods (such as building a distributed tiling environment through multi-machine cluster), the parent node of the cluster needs to push the task data to each child node.

If we create the distributed tiling task based on the multi-process, for the read-only data files, such as read-only UDB data source, SMTiles, etc., the parent node of the cluster just needs to push a task data to child node that opens multi-process, then all the Workers of the chilid node can obtain the data from the specified path.

Howerver, for the distributed tiling under single machine multi-process, it doesn't need to push the task data. The worker nodes can obtain them directly from the Master, thus saving much time.

Notice

Multi-process architecture uses 8900-9000 ports by default, to start the HTTP service. Please confirm that these ports are not occupied, otherwise it will not be able to use the multi-process.

For all ports that SuperMap iServer uses by default, refer to: Port Introduction.