从日志文件解决ArcGIS Server性能低下问题的步骤(1)
ArcGIS Server日志文件分为几个记录级别:
无 - 不记录任何内容。
错误 - 严重问题,需要立即引起注意。
常规 - 关于错误及需要引起注意的问题的警告。
信息:简单 - 服务器的常规管理消息,包括有关服务创建的消息。此级别中还包括警告和错误。
信息:标准 - 由使用服务器而生成的普通消息,每个请求最多记录一次。此级别还包括所有"信息:简单"消息,以及警告和错误。
信息:详细 - 由服务器频繁发出的消息,每个请求可以记录多次,例如,用于通知在地图服务中成功绘制各图层的消息。此级别包括所有"信息:标准"和"信息:简单"消息,同时还包括警告和错误。
详细 - ArcGIS Server 开发人员在测试所开发的服务器对象或服务器对象扩展模块时,可将调试消息归入此级别。此级别包括所有"信息级别"消息,以及警告和错误。
其中信息:详细级别会记录有关图形绘制的消息,因此,在进行缓存切片和处理动态地图请求时MapServer这个Server Object会把详细过程记录到日志文件中。每条日志信息如下所示:
<Msg time='2009-10-31T14:36:05'
type='INFO3'
code='4004'
target='Yellowstone.MapServer'
machine='padisha'
user='Fred'
thread='2936'
elapsed='2.443'>
Server Object instance is successfully created on machine padisha.
</Msg>
其中每一行日志信息都包含了一下几个部分:
- 时间 - 已记录事件发生的时间
- 类型 - 该消息相对于其他消息的详细程度(有关所有详细程度的说明,请参阅解释日志文件。)
- 代码 - 与消息关联的结果代码
- 目标 -"服务器"或与消息相关联的服务配置名称
- 线程 - 生成消息的 SOM 进程线程
- 消息中还可能包括以下附加属性:
- 方法名 - 生成日志消息的方法调用(针对服务)
- 计算机 - 发生事件的服务器对象容器计算机。例如,服务器可能记录无法在特定计算机上创建特定服务配置的服务器上下文的错误。只有应用于为特定计算机记录的统计数据的消息才会包括计算机属性。
- 用户 - 提交请求(从而导致记录消息产生)的用户。该属性在 ArcGIS Server 安全性已启用时十分有用。
-
经历的时间 - 完成记录的事件所需的时间。例如,创建服务器对象事件经历的时间表示创建服务实例所花费的时间。
每一条信息都有其代码,即信息所指意义,通常与服务器对象或操作数据有关。作为服务器核心,以下代码是GIS Server级别的记录信息:
这里可以把服务器当作一个人,一个人在做事之后必然有所反应,如创建画了一幅画,收拾了一下屋子,这是普通信息;还有的是觉得早餐味道不太好,或者今天要上体育课却穿了身爱马仕,这是警告信息;还有是回家时汽车掉到坑里面去,画画时发现少了颜料,这叫错误。
英文版日志代码
1000
Machine can not be added
This error may occur if you attempt to add a new server container machine that does not exist or cannot be found by the SOM.
1001
Machine can not be deleted
Error logged if removing a machine fails.
1002
Configuration name contains illegal characters
1003
Configuration failed to load
This error may be logged if the service configuration file is corrupt or contains invalid values.
1004
Configuration can not be added
Error logged when adding a new service fails, for example, if you attempt to add a service with the same name and type as an existing service.
1005
Configuration can not be deleted
Error logged when deleting a service fails, for example, if you attempt to delete a service that does not exist.
1006
Configuration can not be stopped
Error logged when stopping a service fails, for example, if you attempt to stop a service that is already stopped.
1007
Configuration can not be paused
Error logged when pausing a service fails, for example, if you attempt to pause a stopped or already-paused service.
1008
Configuration can not be started
Error logged when starting a service fails, for example, if you attempt to start an already-started configuration or none of the minimum instances could be started.
1009
Configuration initialization failed
1010
Type not found
Error logged when a server object configuration is trying to use a server object type that is not registered with the server. The registered types are MapServer, GeocodeServer, GeodataServer, GlobeServer, and GPServer.
1011
Server failed to start
1012
Server.dat failed to load
Error logged when the server configuration file, Server.dat, cannot be read on SOM startup, for example, if the SOM startup encounters a corrupted Server.dat or if Server.dat contains invalid values.
1013
Server context creation failed
This error is logged if a client application cannot start using a service. The error occurs if the server fails to create a server context for a client, for example, if the client asks the server to create a context for a server object configuration that does not exist.
1014
Container failed to create. The server process could not be started because the Server or Container accounts are not configured properly or they do not match the server machine you are trying to add to.
Error logged if the server failed to create a new container process on one of the server object container machines. This can happen if the SOM and SOC accounts do not have the same names and passwords on all machines in your ArcGIS Server configuration.
1015
Container failed to create thread.
Error logged if the server failed to create a new thread in a container process on one of the server object container machines.
1016
Server Object instance creation failed
This message may contain more specific error information.
1017
Container process has crashed
Error logged if a container process containing server objects for the target server object configuration crashes. If this is a pooled service, the server will create a new process and services to repopulate the pool.
1018
Server Directory path is invalid
1019
Server Directory can not be added
You may get this error if you attempt to add a server directory if one of the same name and type already exists.
1020
Server Directory can not be deleted
You may get this error if you attempt to delete a server directory that does not exist.
1021
Server Directory can not be updated
You may get this error if you attempt to update a server directory that does not exist.
1022
File not found
Error logged if the server object types file cannot be found when the SOM starts. The server object types file is <ArcGIS Server Installation Directory>\server\system\ServerTypes.dat on Windows or <ArcGIS Server Installation directory>/arcgis/server<ArcGIS version number>/server/system/ServerTypes.dat on Linux/Solaris.
1023
File ServerTypes.dat is empty. No Types registered.
Error logged if the server object types file is empty. The server object types file is <install_location>\Server\system\ServerTypes.dat on Windows or <ArcGIS Server Installation directory>/arcgis/server<ArcGIS version number>/server/system/ServerTypes.dat on Linux/Solaris.
1024
Server does not have write access to a directory
1025
Configuration name is too long
1026
Type name is too long
1027
Failed to create cache for server statistics
1028
Required tag Name is not found in ServerTypes.dat.
This message is applicable to developers who create custom server object extensions.
1029
Required tag CLSID (or PROGID) is not found in ServerTypes.cfg.
This message is applicable to developers who create custom server object extensions.
1030
File failed to load
1031
Server is enabled.
1032
Server is disabled
1033
Warning: SOM configuration changes could not be saved to disk and will not be available when SOM restarts.
1034
Warning: Changes to server object configuration could not be saved to disk and will not be available when SOM restarts.
1035
Warning: Changes to server object extension type configuration could not be saved to disk and will not be available when SOM restarts.
1036
The server has lost its connection to SOC machine. The machine has been dropped from the list of SOC machines but can be manually returned to the list using an administration client like ArcCatalog.
1037
Unexpected error.
An unknown error occurred while trying to disable a SOC machine.
1038
Failed to load properties of a folder. File is missing, unavailable, or invalid.
1039
Failed to save properties of a folder. File is unavailable.
1040
Feature is not supported with ArcGIS Server edition.
This message may appear when ArcGIS Server Enterprise is required.
1041
ArcGIS Server edition is required for feature.
This message may appear if you have ArcGIS Server Workgroup and you attempt an operation that is only supported with Enterprise.
1042
Server object instance creation failed on all SOC machines.
2000
Machine is not found
Message logged if the SOM attempts to create a new container process or thread on a machine that it can't find. This error will typically occur if the machine becomes unavailable (due to a network problem) while the SOM is running.
2001
Machine already exists
Message logged when you attempt to add a server object container machine that has already been added to the GIS server.
2002
Configuration already exists
Message logged when you attempt to add a new server object configuration with the same name and type as an existing server object configuration.
2003
Configuration is not found
Message logged when a client requests a server object configuration that does not exist.
2004
Configuration is not stopped
2005
Configuration is not started
2006
MinInstances value is greater than MaxInstances
When adding or updating server object configuration, minimum or maximum instances specified are invalid, for example, a minimum that is larger than the maximum.
2007
Context timed out
A client held on to a server object for longer than its usage time-out, and the server automatically released it.
2008
Context creation has timed out
An instance of a server object took longer to create than the creation time-out, and the server cancelled the creation.
2009
Server.dat is not found
Message logged if the SOM, while it is running, cannot read the server configuration file Server.dat.
2010
Server configuration contains an invalid parameter
Message logged if the SOM encounters invalid tags or values when reading the Server.dat file.
2011
Server Directory is not found
Message logged if you attempt to find or delete a server directory that does not exist.
2012
Server Directory already exists
Message logged if you attempt to add a new server directory that already exists.
2013
Server has no associated SOC machines or all SOC machines are at capacity.
2014
The server process could not be started because the Server or Continer accounts are not configured propertly or they do not match the server machine you are trying to add to. Check the username and password for these accounts or re-run the Post Install.
2014
Server is not licensed for this operation. You need an Enterprise license to add remote Server Object Container machines.
2014
The license for the machine is not appropriate for this ArcGIS Server. A different license is required.
2015
Server Object Extension type is not registered with Server Object type
2016
Server Object Extension type is already registered with Server Object type
2017
Server Object Extension type was successfully registered with Server Object type
2018
Server Object Extension type could not be registered with Server Object type
2019
The server has lost its connection to SOC machine. The machine was disabled by server.
2020
The server repaired connection to SOC machine. The machine is enabled by server.
2021
Unexpected error
An unknown error occurred while trying to enable a SOC machine.
3000
Machine successfully added
Message logged when the user adds a new server object container machine to the GIS server.
3001
Machine successfully deleted
Message logged when the user removes a server object container machine from the GIS server.
3002
Attempt to load configuration
Message logged for each server object configuration when the SOM starts.
3003
Attempt to add configuration
This event occurs when you either add a new server object configuration or update an existing one.
3004
Attempt to delete configuration
This event occurs when you either delete or update a server object configuration.
3005
Attempt to stop configuration
3006
Attempt to pause configuration
3007
Attempt to start configuration
This message is not logged when server object configurations are started during SOM startup.
3008
Configuration successfully loaded
This message is logged for each server object configuration that was successfully loaded on starting the SOM. This message is logged after a message with code 3002. If the load failed, an error with code 1003 is logged.
3009
Configuration is successfully added
Message logged when the SOM starts and successfully adds the ServerDirectoryManager (SDM) and internal ArcGIS Engine server object configurations.
3010
Configuration is successfully deleted
3011
Configuration is stopped
3012
Configuration is paused
3013
Configuration is started
Note that a successful start may occur after errors have been logged.
3014
Server is successfully started
Note that a successful start may occur after errors have been logged.
3015
Server is stopped
No additional messages will be added to a log file after this message.
3016
Server.dat successfully loaded
Message logged when the SOM starts and the information in Server.dat is successfully loaded.
3017
Server directory is successfully added
3018
Server directory is successfully updated
3019
Server directory is successfully deleted
3020
ArcGIS Server is authorized at the enterprise license level
3020
ArcGIS Server is authorized at the workgroup license level
3020
ArcGIS Server license has been reinitialized
4000
Container is successfully created
This message is logged each time a container process for the target server object configuration is started on a server object container machine.
4001
Thread is successfully created on container
This message is logged each time a thread is created in a container process for the target server object configuration.
4002
Container removed
This message is logged each time a container process for the target server object configuration is removed from a server object container machine.
4003
Thread removed from process machine
This message is logged each time a thread is removed from a container process for the target server object configuration.
4004
Server Object instance is successfully loaded
This message is logged each time an instance of a server object is created in a thread within a container process for the target server object configuration. The elapsed time logged is the amount of time taken to create the server object.
4005
Configuration initialization succeeded
4006
Server context created
This message is logged anytime a client successfully begins using a service. The client application calls CreateServerContext for the target server object configuration. The elapsed time is the wait time between the call to CreateServerContext and when the client receives the server context.
4007
Server context released
This message is logged anytime a client successfully stops using a service. The client calls ReleaseContext for a context created for the target server object configuration. The elapsed time is the usage time between when the client's call to CreateServerContext is completed and when the client is released.
4008
Recycling started
4009
Recycle next object
Message logged when an instance of the target server object configuration is recycled.
4010
ConfigurationFactoryOP creation failed
A common cause of this error is that the GIS Server Post Install has not been run correctly or needs to be re-run. This can happen when you apply a service pack and neglect to re-run the GIS Server Post Install.
4100
Folder already exists
4100
Folders root directory not found
4100
Folder can not be created
4100
Folder name is empty or contains illegal characters
4101
Folder is successfully created
4102
Folder is not empty
4102
Folder can not be deleted
4103
Folder is successfully deleted
4104
Folder is not found
4105
Attempt to rename folder
4106
Folder is successfully renamed
4107
Folder can not be renamed
Folders can only be renamed before they contain any services.
4200
Attempt to validate configuration
4201
Configuration is successfully validated
4202
Configuration is invalid
4203
Configuration validation failed
中文版日志代码
编码
意义
注释
1000
无法添加计算机
如果尝试添加的新服务器容器计算机不存在或 SOM 无法找到,可能会出现此错误。
1001
无法删除计算机
如果移除计算机失败,则会记录此错误。
1002
配置名称包含非法字符
1003
配置加载失败
如果服务配置文件损坏或包含无效的值,可能会记录此错误。
1004
无法添加配置
添加新服务失败(例如,如果尝试添加与现有服务名称和类型相同的服务)时将记录此错误。
1005
无法删除配置
删除服务失败(例如,如果尝试删除不存在的服务)时将记录此错误。
1006
无法停止配置
停止服务失败(例如,尝试停止已停止的服务)时将记录此错误。
1007
无法暂停配置
暂停服务失败(例如,尝试暂停已停止或已暂停的服务)时将记录此错误。
1008
无法启动配置
启动服务失败(例如,尝试启动已启动的配置或无法启动任何最小实例)时将记录此错误。
1009
配置初始化失败
1010
未找到类型
服务器对象配置尝试使用服务器中未注册的服务器对象类型时,将记录此错误。已注册的类型为 MapServer、GeocodeServer、GeodataServer、GlobeServer 和 GPServer。
1011
服务器启动失败
1012
加载 Server.dat 失败
如果 SOM 启动时无法读取服务器配置文件 Server.dat(例如,SOM 启动时 Server.dat 文件已损坏或 Server.dat 包含无效的值),将记录此错误。
1013
服务器上下文创建失败
无法使用服务启动客户端应用程序时将记录此错误。如果服务器为客户端创建服务器上下文失败(例如,客户端要求服务器为不存在的服务器对象配置创建上下文)将出现此错误。
1014
创建容器失败。服务器进程无法启动,因为服务器或容器帐户配置有误或者帐户与帐户要添加到的服务器计算机不匹配。
服务器在其中一个服务器对象容器计算机上创建新容器进程失败时将记录此错误。在 ArcGIS Server 配置中,如果 SOM 和 SOC 帐户在所有计算机上的名称和密码不同,则可能发生此情况。
1015
容器创建线程失败。
在其中一个服务器对象容器计算机上,如果服务器在容器进程中创建新线程失败,将记录此错误。
1016
创建服务器对象实例失败
此消息可能包含更为具体的错误信息。
1017
容器进程已崩溃
如果包含服务器对象(针对目标服务器对象配置)的容器进程崩溃,将会记录此错误。如果这是一个池化服务,服务器将创建新进程和服务以重新填充池。
1018
服务器目录路径无效
1019
无法添加服务器目录
尝试添加服务器目录时如果已经存在相同名称和类型的服务器目录,将出现此错误。
1020
无法删除服务器目录
如果尝试删除不存在的服务器目录,将出现此错误。
1021
无法更新服务器目录
如果尝试更新不存在的服务器目录,将出现此错误。
1022
未找到文件
如果启动 SOM 时无法找到服务器对象类型文件,将记录此错误。服务器对象类型文件为 <ArcGIS Server 安装目录>\server\system\ServerTypes.dat。
1023
文件 ServerTypes.dat 为空。未注册任何类型。
服务器对象类型文件为空时将记录此错误。服务器对象类型文件为 <ArcGIS Server 安装目录>\server\system\ServerTypes.dat。
1024
服务器没有对目录的写入权限
1025
配置名称过长
1026
类型名称过长
1027
为服务器统计数据创建缓存失败
1028
在 ServerTypes.dat 中未找到所需标记 Name。
此消息适用于创建自定义服务器对象扩展的开发人员。
1029
在 ServerTypes.cfg 中未找到所需标记 CLSID(或 PROGID)。
此消息适用于创建自定义服务器对象扩展的开发人员。
1030
文件加载失败
1031
服务器已启用。
1032
服务器已禁用
1033
警告:SOM 配置变更无法保存到磁盘,在 SOM 重新启动时将不可用。
1034
警告:在 SOM 重新启动时,对服务器对象配置所做的更改无法保存到磁盘且将不可用。
1035
警告:在 SOM 重新启动时,对服务器对象扩展类型配置所做的更改无法保存到磁盘且将不可用。
1036
服务器已失去与 SOC 计算机的连接。此计算机已从 SOC 计算机列表中删除,但可以使用诸如 ArcCatalog 之类的管理客户端将其手动添加到列表中。
1037
异常错误。
尝试禁用 SOC 计算机时出现未知错误。
1038
加载文件夹的属性失败。文件丢失、不可用或无效。
1039
保存文件夹的属性失败。文件不可用。
1040
ArcGIS Server 版本不支持此功能。
需要 ArcGIS Server Enterprise 时可能出现此消息。
1041
此功能需要 ArcGIS Server 版本。
如果您有 ArcGIS Server Workgroup 但却要尝试只有 Enterprise 才支持的操作,可能会出现此消息。
1042
在所有 SOC 计算机上创建服务器对象实例均失败。
2000
未找到计算机
如果 SOM 尝试在无法找到的计算机上创建新容器进程或线程,将会记录此消息。如果计算机不可用(由于网络问题)而 SOM 仍在运行,通常会出现这种错误。
2001
计算机已经存在
尝试添加已添加到 GIS 服务器中的服务器对象容器计算机时,将记录此消息。
2002
配置已经存在
尝试添加与现有服务器对象配置名称和类型相同的新服务器对象配置时,将记录此消息。
2003
未找到配置
客户端请求不存在的服务器对象配置时,将记录此消息。
2004
未停止配置
2005
未启动配置
2006
最小实例值大于最大实例值
添加或更新服务器对象配置时,指定的最小或最大实例值无效,例如最小值大于最大值。
2007
上下文超时
如果某客户端占用服务器对象的时间超过其使用超时的时间,则服务器将自动释放该客户端。
2008
上下文创建已超时
创建服务器对象实例所消耗的时间超过创建超时的时间,因此服务器取消此创建过程。
2009
未找到 Server.dat
如果 SOM 运行期间无法读取服务器配置文件 Server.dat,将记录此消息。
2010
服务器配置包含无效的参数
如果 SOM 读取 Server.dat 文件时遇到无效的标记或值,将记录此消息。
2011
未找到服务器目录
如果尝试查找或删除不存在的服务器目录,将记录此消息。
2012
服务器目录已经存在
如果尝试添加的新服务器目录已经存在,将记录此消息。
2013
服务器没有相关联的 SOC 计算机,或所有 SOC 计算机目前均已饱和。
2014
服务器进程无法启动,因为服务器或容器帐户配置有误或者帐户与帐户要添加到的服务器计算机不匹配。检查这些帐户的用户名和密码或重新运行"安装后配置"。
2014
服务器未获得执行此操作的许可。需要拥有企业许可才能添加远程服务器对象容器计算机。
2014
计算机的许可不适用于此 ArcGIS Server。需要另一不同的许可。
2015
服务器对象扩展类型未注册为服务器对象类型
2016
服务器对象扩展类型已注册为服务器对象类型
2017
服务器对象扩展类型已成功注册为服务器对象类型
2018
服务器对象扩展类型无法注册为服务器对象类型
2019
服务器已失去与 SOC 计算机的连接。计算机被服务器禁用。
2020
服务器已修复与 SOC 计算机的连接。计算机被服务器启用。
2021
异常错误
尝试启用 SOC 计算机时出现未知错误。
3000
已成功添加计算机
用户将新服务器对象容器计算机添加到 GIS 服务器时,将记录此消息。
3001
已成功删除计算机
用户从 GIS 服务器中移除服务器对象容器计算机时,将记录此消息。
3002
试图加载配置
SOM 启动时,将为每个服务器对象配置记录此消息。
3003
试图添加配置
添加新的服务器对象配置或更新现有服务器对象配置时将出现此情况。
3004
试图删除配置
删除或更新服务器对象配置时将出现此情况。
3005
试图停止配置
3006
试图暂停配置
3007
试图启动配置
在 SOM 启动期间启动服务器对象配置时,将不记录此消息。
3008
成功加载配置
启动 SOM 时,对每个成功加载的服务器对象配置都将记录此消息。此消息记录在代码为 3002 的消息之后。如果加载失败,将记录代码为 1003 的错误。
3009
已成功添加配置
SOM 启动并成功添加服务器目录管理器 (SDM) 和内部 ArcGIS Engine 服务器对象配置时,将记录此消息。
3010
已成功删除配置
3011
已停止配置
3012
已暂停配置
3013
已启动配置
请注意,成功启动可能会出现在记录错误之后。
3014
服务器已成功启动
请注意,成功启动可能会出现在记录错误之后。
3015
服务器已停止
出现此消息之后日志文件中不再添加其他消息。
3016
成功加载 Server.dat
SOM 启动且 Server.dat 中的信息成功加载后,将记录此消息。
3017
已成功添加服务器目录
3018
已成功更新服务器目录
3019
已成功删除服务器目录
3020
ArcGIS Server 得到企业许可等级的授权
3020
ArcGIS Server 得到工作组许可等级的授权
3020
ArcGIS Server 许可已重新初始化
4000
已成功创建容器
每次在服务器对象容器计算机上启动目标服务器对象配置的容器进程时,都将记录此消息。
4001
在容器上成功创建线程
每次在容器进程中为目标服务器对象配置创建线程时,都将记录此消息。
4002
已移除容器
每次从服务器对象容器计算机中移除目标服务器对象配置的容器进程时,都将记录此消息。
4003
线程已从计算机的进程中移除
每次从目标服务器对象配置的容器进程中移除线程时,都将记录此消息。
4004
已成功加载服务器对象实例
每次在目标服务器对象配置的容器进程内部的线程中创建服务器对象实例时,都将记录此消息。记录所经历的时间是创建服务器对象所消耗的时间。
4005
配置初始化成功
4006
已创建服务器上下文
每当客户端成功开始使用服务时,都将记录此消息。客户端应用程序为目标服务器对象配置调用 CreateServerContext。经历的时间是调用 CreateServerContext 与客户端接收服务器上下文之间的等待时间。
4007
已释放服务器上下文
每当客户端成功停止使用服务时,都将记录此消息。客户端将为针对目标服务器对象配置而创建的上下文调用 ReleaseContext。经历的时间是客户端完成调用 CreateServerContext 的时刻与释放客户端的时刻之间的使用时间。
4008
回收已开始
4009
回收下一个对象
回收目标服务器对象配置的实例时,将记录此消息。
4010
ConfigurationFactoryOP 创建失败
此错误的常见原因是 GIS Server 安装后配置未正确运行或需要重新运行。应用服务包却未重新运行 GIS Server 安装后配置时可能出现此情况。
4100
文件夹已存在
4100
未找到文件夹根目录
4100
无法创建文件夹
4100
文件夹名称为空或包含非法字符
4101
已成功创建文件夹
4102
文件夹不为空
4102
无法删除文件夹
4103
已成功删除文件夹
4104
未找到文件夹
4105
试图重命名文件夹
4106
已成功重命名文件夹
4107
无法重命名文件夹
重命名文件夹时,文件夹中不得包含任何服务。
4200
试图验证配置
4201
已成功验证配置
4202
配置无效
4203
配置验证失败
此外,针对特定地图服务,还有地图服务的日志代码,主要是对某一服务的一项操作返回的信息:请参考http://help.arcgis.com/zh-cn/arcgisserver/10.0/help/arcgis_server_dotnet_help/0093/0093000000n2000000.htm
-
为什么会变慢
一个请求提交的过程要经过Web服务器,GIS服务器,数据库服务器这三层的处理。这仅仅是逻辑示意图,可以有多个层在同一台机器上。每一层出了问题,都有可能影响速度,究竟怎样判断问题根源所在呢?敬请期待,下回分解。