十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Linux性能优化工具系列详解(5)

Linux性能优化工具系列详解(5) 接前一篇文章Linux性能优化工具系列详解4本系列内容参考极客时间 —— 倪朋飞 《Linux 性能优化实战》特此致谢系列工具2. mpstat2详情选项……-u Report CPU utilization. The following values are displayed:CPU Processor number. The keyword all indicates that statistics are calculated as averages among all processors.%usr Show the percentage of CPU utilization that occurred while executing at the user level (application).%nice Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.%sys Show the percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time spent servicing hardware and software interrupts.%iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.%irq Show the percentage of time spent by the CPU or CPUs to service hardware interrupts.%soft Show the percentage of time spent by the CPU or CPUs to service software interrupts.%steal howS the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.%guest Show the percentage of time spent by the CPU or CPUs to run a virtual processor.%gnice Show the percentage of time spent by the CPU or CPUs to run a niced guest.%idle Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.-u报告CPU利用率。显示以下值CPU —— 处理器编号。关键字all表示统计数据是作为所有处理器之间的平均值计算的。%user —— 显示在用户级别应用程序执行时发生的CPU利用率百分比。%nice —— 显示在具有nice优先级的用户级别执行时发生的CPU利用率百分比。%sys —— 显示在系统级别内核执行时发生的CPU利用率百分比。请注意这不包括为硬件和软件中断提供服务所花费的时间。%iowait —— 显示CPU空闲的时间百分比在此期间系统有未完成的磁盘I/O请求。%irq —— 显示CPU或CPU处理硬件中断所花费时间的百分比。%soft —— 显示CPU或CPU组处理软件中断所花费时间的百分比。%steal —— 显示了当管理程序为另一个虚拟处理器提供服务时虚拟CPU或多个CPU在非自愿等待中花费的时间百分比。%guest —— 显示CPU运行虚拟处理器所花费的时间百分比。%gnice —— 显示CPU运行niced guest所花费的时间百分比。%idle —— 显示CPU空闲的时间百分比以及系统没有待处理的磁盘I/O请求的情况。-V Print version number then exit.-V打印版本号并退出。ENVIRONMENTThe mpstat command takes into account the following environment variable:环境mpstat命令考虑了以下环境变量S_COLORSBy default statistics are displayed in color when the output is connected to a terminal. Use this variable to change the settings. Possible values for this variable are never, always or auto (the latter is equivalent to the default settings).Please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. It only indicates different ranges of values.S_COLORS默认情况下当输出连接到终端时统计数据以彩色显示。使用此变量更改设置。此变量的可能值为never、always或auto后者相当于默认设置。注意用于显示值的颜色红色、黄色或其他颜色并不能仅仅因为颜色而表示任何问题。它只表示不同的值范围。S_COLORS_SGRSpecify the colors and other attributes used to display statistics on the terminal. Its value is a colon-separated list of capabilities that defaults to H31;1:I32;22:M35;1:N34;1:Z34;22. Supported capabilities are:H SGR (Select Graphic Rendition) substring for percentage values greater than or equal to 75%.I SGR substring for CPU number.M SGR substring for percentage values in the range from 50% to 75%.N SGR substring for non-zero statistics values.Z SGR substring for zero values.S_COLORS_SGR指定用于在终端上显示统计信息的颜色和其它属性。其值是一个以冒号分隔的功能列表默认为H31;1:I32;22:M35;1:N34;1:Z34;22。支持的功能包括H —— 大于或等于75%的百分比值的SGRSelect Graphic Rendition子字符串。I —— CPU编号的SGR子字符串。M —— 50%至75%范围内的百分比值的SGR子字符串。N —— 非零统计值的SGR子字符串。Z 零值的SGR子字符串。S_TIME_FORMATIf this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The mpstat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp will also be compliant with ISO 8601 format.S_TIME_FORMAT如果此变量存在并且其值为ISO则在打印报告标题中的日期时将忽略当前区域设置。mpstat命令将使用ISO 8601格式YYYY-MM-DD。时间戳也将符合ISO 8601格式。EXAMPLESmpstat 2 5Display five reports of global statistics among all processors at two second intervals.mpstat -P ALL 2 5Display five reports of statistics for all processors at two second intervals.示例mpstat 2 5以两秒的间隔在所有处理器之间显示五份全局统计报告。mpstat -P ALL 2 5以两秒的间隔显示所有处理器的五份统计报告。BUGS/proc filesystem must be mounted for the mpstat command to work.BUGS/proc文件系统必须被挂载mpstat命令才能正常工作。FILES/proc contains various files with system statistics.文件/proc包含各种具有系统统计信息的文件。AUTHORSebastien Godard (sysstat at orange.fr)作者Sebastien Godard (sysstat at orange.fr)。SEE ALSOsar(1), pidstat(1), iostat(1), vmstat(8)https://github.com/sysstat/sysstathttp://pagesperso-orange.fr/sebastien.godard/另请参阅sar(1), pidstat(1), iostat(1), vmstat(8)https://github.com/sysstat/sysstathttp://pagesperso-orange.fr/sebastien.godard/更多内容请看下回。
返回列表