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.
- Master is the main process of iServer, to start, coordinate and manage all nodes: Worker, in the system, when you start multi process of iServer, current iServer will be recognized as the Master node. to ensure the availability of the main node, Master node doesn't handle the detailed business, for example, it does not provide GIS service, neither takes part in distributed map cutting.
- Worker is the multi iServer process which is started and managed by Master, one Worker matches iServer process of one port, it could support service publishment, GIS request handling and to take part in distributed map cutting.
- Daemon is the monitor process of iServer, it monitors and starts Master node, to avoid it failes. When you start iServer, the Daemon is started automatically, no need to configurate or manage this process.
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.
- Visiting iServer service management, click service, advance, multi-process configuration by order.
- 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.
- Set the Java virtual machine memory. The default is 1024M
- 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.
- Set connection timeout between the master node and child node. The unit is milliseconds.
- Set port range of Worker process by your network condition, default is from 8900- 9000, Work port will increase from 8900.
- 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.
- Restart iServer, to effect multi-process configuration.
- 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.
- 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:
- Login on server management of iServer main node Master, click service, advance, multi-process configuration by order.
- In the multi-process configuration page, set NO. of Worker, it could be biger or smaller than before.
- Reset the port range of the Worker process as needed.
- After click save configuration, iServer will dynamically adjust every Worker by your configuration, including updating port and deployed GIS service.
- 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:
- Uni-visit service in the service list page of Master node, although the visiting service address is still the original iServer address, but when visiting the specific service, Master will request to map it to the child node by demanding.
- Unify management service in the "service management" page of the Master node.
- Publish service in the service management of Master node, Master will deploy service onto one Worker by the load automatically.
- Unify access control information, for example, user account, in the "safety" module of Master node, safety configuration works for all Worker, and you will not feel the existence of Worker.
- Monitor all the service visiting status, statistics of the service visiting data in the "monitoring and statistics" module of the Master node.
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 you are publishing workspace, select "Enable multi-instance", and input "instance count", following the publishing workspace steps to finish the configuration. After enabling multi-instance, the instances number is the same as the number of Workers by default.
- For published workspaces, you need to enter into the "Service Management" page on the Master node, then enable multi-instance function on its service provider configuration page. But if the workspace has been published two or more types of services, this method won't work.
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:
- Set the number of instances on the "Service Management" page of the Master node. On "Service Management" page, click the corresponding service provider, then modify the "Instance count" in the "Basic info" area, then click "save" button.
- Set the number of instances on the "Component(Set)s" page of the Master node. On "Component(Set)s" page, click the corresponding service component, then modify the "Instance count" in the "Basic Configuration" area, then click "save" button.
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:
- In the service provider configuration file, add <isMultiInstance>true</isMultiInstance> to enable multi-instance. This configration is only for workspace service source.
<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>
- In the service component configuration file, modify the value of instanceCount to set the number of instances.
<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:
- GIS service NO. is big, and matches multi-work space data.
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.
- Distributed map tiling
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.