主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

mps-status

WindowsLinuxmacOS 系统上从命令行显示服务器实例的状态

语法

mps-status [-C [path/]server_name][--statistics|-s [sample_interval]] [--json|-j]

描述

mps-status [-C [path/]server_name][--statistics|-s [sample_interval]] [--json|-j] 显示服务器(STARTEDSTOPPED)的状态以及服务器实例的完整路径。此外,它还可以显示有关服务器的性能统计数据,包括:

  • 采样间隔(以毫秒为单位)

  • CPU 利用率

  • 活跃工作进程进程数

  • 队列中的请求数

  • 内存使用量

  • 每秒请求吞吐量

  • 总排队时间(以毫秒为单位)

输入参数

-C path/

指定服务器实例的路径。如果省略此选项,则搜索当前工作文件夹及其父文件夹来查找服务器实例。

server_name

需要查询状态的服务器

--statistics [sample_interval], -s [sample_interval]

指定要收集并显示的统计数据。

可选的 sample_interval 允许您指定收集统计信息的间隔(以毫秒为单位)。默认值为 500。

注意

如果指定采样间隔为 0,则仅进行一次采样。需要两个样本来计算一些统计数据,例如 CPU 利用率和吞吐量。

--json, -j

指定统计信息以 JSON 格式输出:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Instance Status",
    "description": "Status and Statistics for a MATLAB Production
                    Server Instance",
    "type": "object",
    "properties": {
        "instancePath": {
            "description": "Filesystem path for the server 
                            instance",
            "type": "string"
        },
        "started": {
            "type": "boolean"
        },
        "license": {
            "type": "object",
            "properties": {
                "status": {
                    "enum": [ "CHECKED_OUT", "IN_GRACE_PERIOD",
                              "GRACE_PERIOD_EXPIRED" ]
                },
                "type": {
                    "enum": [ "INVALID", "UNKNOWN", "COMPILED", 
                              "TRIAL", "EDU", "COMM" ]
                },
                "number": {"type": "string"}
            },
            "required": ["status"]
        },
        "statistics": {
            "type": "object",
            "properties": {
                "sampleIntervalMS": {
                    "description": "The difference in upTime 
                                    between the two samples, 0 if
                                    only a single sample was
                                    taken",
                    "type": "number"
                },
                "localTime": {
                    "description": "Local Time at server in format 
                                    YYYY.MM.DD HH.MM.SS.SSSSSS",
                    "type": "string"
                },
                "upTime": {
                    "description": "Time since server start in
                                    fractional seconds",
                    "type": "number"
                },
                "cpuTime": {
                    "description": "CPU time consumed by all server
                                    processes in fractional 
                                    seconds",
                    "type": "number"
                },
                "cpuPercentage": {
                    "description": "CPU utilzation, computed using
                                    change in cpuTime and upTime
                                    between two samples",
                    "type": "number"
                },
                "totalRequestsReceived": {
                    "description": "The number of valid requests
                                    received",
                    "type": "integer"
                },
                "totalRequestsStarted": {"type": "integer"},
                "totalRequestsFailedToStart": {
                    "description": "The number of requests that
                                    could not be started",
                    "type": "integer"
                },
                "totalRequestsFinishedHttpSuccess": {
                    "type": "integer"
                },
                "totalRequestsFinishedHttpError": {
                    "description": "Note: does not includes
                                    requests that failed to start",
                    "type": "integer"
                },
                "memoryWorkingSet": {
                    "description": "Amount of memory resident in
                                    physical memory for all
                                    processes (KiB)",
                    "type": "number"
                },
                "throughput": {
                    "description": "Requests retired per second,
                                    computed using the number of
                                    requests finished or failed to
                                    start over two samples",
                    "type": "number"
                },
                "totalQueueTimeMS": {
                    "description": "Sum of the wait times for
                                    currently queued requests",
                    "type": "number"
                }
            }
        }
    },
    "required": ["instancePath", "started"]
}

示例

全部展开

显示位于 tmp 文件夹中的服务器实例 server_1 的状态。

在系统命令提示符下键入以下内容:

mps-status -C /tmp/server_1

如果服务器正在运行并且使用有效许可证运行,则输出:

'/tmp/server_1' STARTED
license checked out

如果服务器未运行,则输出:

'/tmp/server_1' STOPPED

显示位于 tmp 文件夹中的服务器实例 server_1 的统计信息。

在系统命令提示符下键入以下内容:

mps-status -C /tmp/server_1 -s
如果服务器正在运行并且使用有效许可证运行:

'/tmp/server_1' STARTED
license checked out
Statistics:
Sample Interval (ms):     500
CPU Utilization (%):      40
Active Worker Processes:  2
Requests in Queue:        1
Memory Usage (KiB):       1024
Throughput (requests/s):  10
Total Queue Time (ms):    100

显示位于 tmp 文件夹中的服务器实例 server_1 的统计信息。

在系统命令提示符下键入以下内容:

mps-status -C /tmp/server_1 -s -j
如果服务器正在运行并且使用有效许可证运行:

{
    "instancePath":"L:\\MPS\\stats",
    "license":{
        "number":"unknown",
        "status":"CHECKED_OUT",
        "type":"COMM"
    },
    "started":true,
    "statistics":{
        "cpuPercentage":0,
        "cpuTime":1.7628113000000001,
        "localTime":"2015.04.28 16:52:49.874483",
        "memoryWorkingSet":393468,
        "sampleIntervalMS":500.31748899999951,
        "throughput":0,
        "totalQueueTimeMS":0,
        "totalRequestsFailedToStart":0,
        "totalRequestsFinishedHttpError":0,
        "totalRequestsFinishedHttpSuccess":0,
        "totalRequestsReceived":0,
        "totalRequestsStarted":0,
        "upTime":6.9780032949999997
    }
}

版本历史记录

在 R2012b 中推出