26

2025Mar

The only thing we have to fear is fear itself.

我们唯一需要害怕的是害怕本身。

pidstat 命令查看nginx上下文切换

pidstat -w -p 711 1

[root@leilei ~]# ps -ef|grep nginx
root     13974     1  0 14:23 ?        00:00:00 nginx: master process nginx
www      13975 13974  0 14:23 ?        00:00:00 nginx: worker process
www      13976 13974  0 14:23 ?        00:00:00 nginx: worker process
www      13977 13974  0 14:23 ?        00:00:00 nginx: cache manager process
root     18769  9104  0 14:49 pts/0    00:00:00 grep --color=auto nginx

[root@leilei ~]# pidstat -w -p 13975 1
Linux 3.10.0-693.el7.x86_64 (leilei) 	04/28/2020 	_x86_64_	(2 CPU)

02:49:27 PM   UID       PID   cswch/s nvcswch/s  Command
02:49:28 PM  1000     13975      0.00      0.00  nginx
02:49:29 PM  1000     13975      0.00      0.00  nginx
02:49:30 PM  1000     13975      0.00      0.00  nginx
02:49:31 PM  1000     13975      0.00      0.00  nginx
02:49:32 PM  1000     13975      0.00      0.00  nginx
02:49:33 PM  1000     13975      0.00      0.00  nginx

如果 cswch/s 较为均匀,说明切换正常
posted @   陈雷雷  阅读(414)  评论(0编辑  收藏  举报
编辑推荐:
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
· ASP.NET Core 模型验证消息的本地化新姿势
· 对象命名为何需要避免'-er'和'-or'后缀
阅读排行:
· “你见过凌晨四点的洛杉矶吗?”--《我们为什么要睡觉》
· 编程神器Trae:当我用上后,才知道自己的创造力被低估了多少
· C# 从零开始使用Layui.Wpf库开发WPF客户端
· C#/.NET/.NET Core技术前沿周刊 | 第 31 期(2025年3.17-3.23)
· 接口重试的7种常用方案!
点击右上角即可分享
微信分享提示