嗨 Linux/UNIX 霸主,
对于 Linux 服务器上有多少上下文切换(每个处理器核心)是正常的,你们中有人有经验法则吗?
我在这里的大学提出了它,他在 8 核x86_64机器上看到了 16K 。
以下是过去几天来自 sarface 的一些统计数据......
替代文字 http://src.autonomy.net.au/imagebin/81895e338fae67d3d205c09db44a81e6-Picture_10.png
要查看进程创建统计信息,请查看同一图表的对数视图...
替代文字 http://src.autonomy.net.au/imagebin/7481f7e52bead4effc90248fc23c72fe-Picture_11.png
而且8核都闷死了……
替代文字 http://src.autonomy.net.au/imagebin/0e94326652e977fd74edcd840f94200f-Picture_12.png
CS 与 IOwait(x10000 比例)
替代文字 http://src.autonomy.net.au/imagebin/a52a2a8a120394849c0da4045933e306-Picture_13.png
如果有人问,更多无用的信息..
根据 vmstat,我的 Linux 服务器(2xCore2 Duo 2.5 GHz)每秒持续进行大约 20k 次上下文切换。
# vmstat 3
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 7292 249472 82340 2291972 0 0 0 0 0 0 7 13 79 0
0 0 7292 251808 82344 2291968 0 0 0 184 24 20090 1 1 99 0
0 0 7292 251876 82344 2291968 0 0 0 83 17 20157 1 0 …Run Code Online (Sandbox Code Playgroud) performance-monitoring kernel performance-tuning vmstat context-switch
我正在寻找一个粗略的值来比较 Windows 和 Linux 之间的上下文切换(假设相同的硬件和类似的负载)。我发现 Windows 的时间片长度范围似乎比 Linux 小(10-120 毫秒与 10-200 毫秒),但该信息不具有权威性。