1. Background
Recently there have been two consecutive projects on the scene of the AGS service swing off the problem, one is the Tongzhou scene, one is Fuzhou scene.
1.1 Problem description and solution in Tongzhou field
Tongzhou site Environment for ArcGIS9.2, using the map service issued by the IMS, the problem is that every two days or so, its topographic map service will crash once, after restarting the topographic mapping service maps can be displayed normally.
Because the map in IMS is a dynamic plot, it needs to be connected to SDE when it is out, and the problem is likely to be the maximum number of connections in SDE.
1.2 The problem description and solution of Fuzhou scene
Fuzhou field environment for ArcGIS10.0, the use of the ArcGIS server published by the vector service (MAP server), the problem is that the basic daily vector service will swing off once, reboot, the system will be able to run normally.
There are a number of reasons for the vector service to swing out, and there are several possibilities:
(1) The cache in ArcGIS server is not cleaned up regularly, causing too many caches to swing out.
(2) Because of the Windows Firewall, the context and SDE connection limit after a period of time, will be killed by the system, but the context is not aware of, so in the first visit after idle for some time, still use the link, not connected to SDE cause crash.
(3) The vector query needs to connect to the database through the SDE, will not set the maximum number of SDE connections, resulting in service swing off.
(4) because the vector query also needs to use the database cursor, will not set the maximum number of cursors in the database, resulting in service swing off.
2. Solve the problem of Tongzhou Field 2.1 first set the maximum number of connections
The default number of SDE connections is 48, and there are two ways to modify it, one through the registry and one through the database. Here I will make a description of the two methods of modification.
2.1.1 Through registry modification
Open the SDE installation directory (the general installation path is C: \ arcgis\arcsde\sqlexe\etc) giomgr.defs file for editing, set the connections parameter to your maximum number of connections. Import into the database by command: Sdeconfig–o import–f c:\arcgis\arcsde\sqlexe\etc\giomgr.defs–i ESRI_SDE (db instance name) –s (ServerName) –u SDE ( User name) –p sde (password). You will need to restart the SDE service to take effect after setup.
2.1.2 through the database.
Run SELECT * from Sde.server_config; modify connections Num_prop_value in this table.
2.2 Modifying the Tcpkeepalive configuration
The biggest contributor to the ability to delete invalid connections is tcpkeepalive. The Tcpkeepalive parameter controls whether the database periodically checks whether the connection is an invalid connection based on the configured interval time, and if so, automatically deletes the connection.
For example, when the tcpkeepalive parameter is set to True, the database constantly detects whether all connections are invalid and, if the connection is invalid, automatically deletes the connection based on the response time provided by the registry key of the machine on which the SDE service resides KeepAliveTime.
The modification of this parameter is the same as the maximum number of connections to SDE, and there are two ways to refer to the method described in the previous section.
2.3 Modifying the configuration of the KeepAliveTime
Here comes another parameter: KeepAliveTime.
For machines that are installed by default on the operating system, the KeepAliveTime registry key is not available, and if not, the server does not actively send keepalive packets to confirm that the idle connection remains unchanged and that no deletions are made. Therefore, the above mentioned invalid connection will be more and more. We can add the DWORD entry in the following path: Local_machine\system\currentcontrolset\services\tcpip\parameters: KeepAliveTime. In this way, the KeepAliveTime entry is in the registry of the system.
If the system already has the KeepAliveTime key, we do not fill in its value, it is two hours by default. Based on the experience of others online, the recommended setting is 5 minutes. However, depending on the project, the final restart of SDE will take effect.
2.4 Continue modification--Modify the SharedSection in the registry
We set the above three configurations in Tongzhou site, after two days, the scene reflects the map service or swing off. So we looked at the data again and found that there was a key place to configure the--sharedsection.
Windows assigns a fixed-size memory (the default 512K) for each service. Each SDE process requires approximately 9K of memory, so the SDE default number of connections is 512/9 approximately equal to 48.
If we do not modify the configuration of this fixed-size memory, we will not be able to take effect even if we have changed the maximum number of SDE configurations to 128.
According to the above conversion method, 9*128=1152, and then we appropriately change it to 1024.
Finally we found sharedsection in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\subsystems\windows, and change the third item in the original sharedsection=1024,3072,512 to 1024. After the change, it has been two weeks, the scene reflects the map service did not go off.
3. Solve Fuzhou field Problem 3.1 Modify periodically clear the cache--No effect
By http://192.168.101.9:8399/arcgis/rest/admin this connection into the Administration page, and then set a time each day to periodically clear the cache. To the site after the modification, the next day the site engineering staff reply or swing off.
3.2 Switch off the firewall, and set the service to connect to the database again after a period of time to check whether the connection is normal-no effect
In the serviceproperties of the service, set the interval for this periodic check connection. The site was modified for 30 minutes. The next day to ask the scene, on-site feedback service or swing off.
3.3 Modifying the database maximum number of cursors, and the associated configuration of the SDE maximum number of connections--success
Careful observation of the error log, found in a number of errors in the following error. Guess the number of database cursors may be set small.
by show parameter open_cursors; View the number of cursors in the field is 250.
by select COUNT (*) from v$open_cursor; View the number of current cursor opening in the field, it is found that the number is over 200 when the vector service is closed.
open_cursors=2000 Scope=both by Alter system set, and the number of cursors is larger.
For insurance purposes, the maximum number of SDE connections and the configuration of the kill process are all modified by the steps mentioned above.
At present, after two weeks, the scene has no more services to swing out of the situation.
4. Summary
(1) It is ineffective to modify only the maximum number of SDE connections, without modifying the SharedSection in the registry.
(2) because the vector query and database are directly related, each query needs to use a cursor, if the cursor settings in the database is too small, it is easy to cause vector query crash.
-----------above is my idea and method to solve this problem, if friends you have a better way, please leave a message to inform, not very grateful.