我在一台机器上使用netty nio进行客户端服务器通信。
除了在某些windows 2003机器上,许多服务器上的相同客户机/服务器程序都可以正常工作。
如果服务器没有运行,客户端试图连接(正如预期的那样,在超时后出现异常),服务器上的中断数量将急剧增加。
通常,当客户端试图连接中断时,中断的数量(如所显示的)在avg 300/s上,达到大约1000/s。
只要客户端正在运行,中断/s仍然很高,即使它不尝试重新连接,并且一旦能够连接,它仍然很高。
如果客户端可以在第一次尝试时连接到服务器,则不会发生这种情况。
中断计数的增加会导致服务器时钟的强漂移。
关于发生了什么以及如何避免它的任何想法或建议吗?
阅读后:http://blogs.technet.com/b/markrussinovich/archive/2008/04/07/3031251.aspx
我运行KernRate的结果如下:
当客户端试图连接时:
P0 K 0:00:00.015 ( 0.2%) U 0:00:00.031 ( 0.4%) I 0:00:07.265 (99.4%) DPC
0:00:00.000 ( 0.0%) Interrupt 0:00:00.000 ( 0.0%)
Interrupts= 6117, Interrupt Rate= 837/sec.
Context Switches , 307153, 42004/sec.
System Calls , 404125, 55265/sec.
Page Faults , 1050, 144/sec.
I/O Read Operations , 143, 20/sec.
I/O Write Operations , 386, 53/sec.
I/O Other Operations , 1407, 192/sec.
I/O Read Bytes , 14712, 103/ I/O
I/O Write Bytes , 49575, 128/ I/O
I/O Other Bytes , 182356, 130/ I/O
Module Hits msec %Total Events/Sec
intelppm 11144 7311 97 % 38106962
ntoskrnl 196 7311 1 % 670222
hal 69 7311 0 % 235945
win32k 53 7311 0 % 181233
ramirr2 6 7311 0 % 20517
afd 2 7311 0 % 6839
tcpip 2 7311 0 % 6839
Ntfs 1 7311 0 % 3419
bxvbdx 1 7311 0 % 3419当客户端进程没有运行时:
P0 K 0:00:00.015 ( 0.3%) U 0:00:00.000 ( 0.0%) I 0:00:04.546 (99.7%) DPC
0:00:00.000 ( 0.0%) Interrupt 0:00:00.000 ( 0.0%)
Interrupts= 2213, Interrupt Rate= 485/sec.
Total Avg. Rate
Context Switches , 9398, 2060/sec.
System Calls , 29104, 6379/sec.
Page Faults , 2158, 473/sec.
I/O Read Operations , 130, 28/sec.
I/O Write Operations , 273, 60/sec.
I/O Other Operations , 619, 136/sec.
I/O Read Bytes , 12029, 93/ I/O
I/O Write Bytes , 37754, 138/ I/O
I/O Other Bytes , 92840, 150/ I/O
Module Hits msec %Total Events/Sec
intelppm 7208 4561 99 % 39508879
ntoskrnl 20 4561 0 % 109625
win32k 10 4561 0 % 54812
hal 4 4561 0 % 21925
ramirr2 3 4561 0 % 16443
tcpip 3 4561 0 % 16443
Ntfs 1 4561 0 % 5481-罗恩
发布于 2012-05-29 07:42:50
这个问题在bug 356-Bug在HashedWheelTimer.waitForNextTick()?的修补程序中得到了解决。
这个错误是由windows在java调用Thread.sleep()时生成中断引起的,如果时间小于10 ms,则通过不休眠来解决。
应用此更改后,中断速率保持不变。
https://stackoverflow.com/questions/10536798
复制相似问题