mps-profile
在 Windows、Linux 和 macOS 系统上从命令行记录服务器实例的配置文件信息
语法
mps-profile [-C [path
/]server_name
] [state
] [object
...]
描述
mps-profile
根据 state
启动或停止在主日志中记录服务器配置文件信息。object
指定要记录的信息。您可以指定多个对象。您可以记录有关服务器请求的信息,例如客户端的 IP 地址、客户端请求的存档以及工作进程池。
要设置或更新已运行服务器的分析选项而不重新启动服务器,请使用 mps-profile
命令。要在配置服务器时设置分析选项,请指定 profile
属性。运行 mps-profile
将覆盖使用 profile
属性设置的任何分析选项。
注意
激活分析会对性能产生负面影响。
输入参数
| 服务器实例的路径。如果省略此选项,则搜索当前工作文件夹及其父文件夹来查找服务器实例。 |
| 要分析的服务器实例的名称。 |
| 标志控制服务器是否将配置文件信息写入主日志。有效状态为:
|
| 要记录的信息。有效对象为:
对象是分层的。例如,指定 如果您未指定对象,服务器将记录所有对象的配置文件消息。 |
示例
记录服务器请求和工作进程池的配置文件信息。
在系统命令提示符下键入以下任一项:
mps-profile on
或者:
mps-profile on server
无需打开工作进程池分析即可记录服务器请求的分析信息。
在系统命令提示符下键入以下内容:
mps-profile on server.request
记录有关服务器请求和工作进程池中的存档的配置文件信息。
在系统命令提示符下键入以下内容:
mps-profile on server.request.archives server.worker.pool
停止记录所有配置文件信息。
mps-profile off
仅停止记录工作进程池信息。
mps-profile off server.worker.pool
以下是包含所有对象的分析信息的主日志的摘录。
93 [2020.03.19 13:05:56.554236] [profile] [client:[::1]:62736] [component:mymagic] [connection_id:2] [function:magic] [mode:sync] [request_id:0:1:1][service:http-connection] [type:request_arrive] Request arrived and was placed in the queue. 94 [2020.03.19 13:05:56.554236] [profile] Request to allocate next available worker 95 [2020.03.19 13:05:56.555240] [profile] Lease created for worker-1 96 [2020.03.19 13:05:56.555240] [profile] [client:[::1]:62736] [request_id:0:1:1] [type:request_start] [worker_id:1] Request started executing on worker 1 ... 99 [2020.03.19 13:05:56.558233] [profile] [client:[::1]:62736] [request_id:0:1:1] [type:request_finish] [worker_id:1] Request completed with HTTP status 200 100 [2020.03.19 13:05:56.558233] [profile] Lease terminated for worker-1 101 [2020.03.19 13:05:56.558233] [profile] worker-1 PASSED health check; returning to the pool