Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy9-Jun-04 16:34
scadaguy9-Jun-04 16:34 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos10-Jun-04 1:48
Angelos Petropoulos10-Jun-04 1:48 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy10-Jun-04 2:27
scadaguy10-Jun-04 2:27 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos10-Jun-04 13:25
Angelos Petropoulos10-Jun-04 13:25 
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy11-Jun-04 3:06
scadaguy11-Jun-04 3:06 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 3:27
Angelos Petropoulos11-Jun-04 3:27 
GeneralRe: IO completion ports and unexpected performance. Pin
k.mohan kumar28-Jan-09 20:11
k.mohan kumar28-Jan-09 20:11 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 1:44
Angelos Petropoulos11-Jun-04 1:44 
Well I run some more tests, this time making sure everything was in order and that the environment was a good simulation of a real-world application.

I coded a client and a server app. I run the client app on a machine on the LAN and the server app on my machine. Below are the test results:

Using threads, 100 clients, 50ms wait between sends
CPU Time: 4ave, 10max
Context Switches/sec: 814ave, 928max

Using IOCP, 100 clients, 50ms wait between sends
CPU Time: 11ave, 16max
Context Switches/sec: 238ave, 407max



Using threads, 500 clients, 50ms wait between sends
CPU Time: 27ave, 41max
Context Switches/sec: 3983ave, 4200max

Using IOCP, 500 clients, 50ms wait between sends
CPU Time: 59ave,69 max
Context Switches/sec: 587ave, 908max



Using threads, 1000 clients, 50ms wait between sends
CPU Time: 36ave, 46max
Context Switches/sec: 6083ave, 6227max

Using IOCP, 1000 clients, 50ms wait between sends
CPU Time: 74ave, 91max
Context Switches/sec: 205ave, 302max


Well, to be honest I'm not sure what to make of the results. Context switches seem to benefit substantially from the use of IOCP, but what good is that when the CPU utilization is twice or more as high? Since context switches are CPU intensive and using IOCP lowers their number, where is all the extra CPU utilization coming from? Is it just that IOCP are not properly implemented within the .NET Framework?

Another interesting find has been the private boolean static property UseOverlappedIO found in the Socket class. You can get to it through reflection, and if you do you will find that its value is always set to false. I found these two usenet messages related to the matter, but no conclusion was reached ...

Thread #1[^]

Thread #2[^]

I just don't understand why using IOCP would involve such a CPU utilization increase. I'm lost, I guess I'll stick to having 100s of threads within my application ...

Regards,
Angelos Petropoulos
GeneralRe: IO completion ports and unexpected performance. Pin
scadaguy11-Jun-04 3:24
scadaguy11-Jun-04 3:24 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 3:37
Angelos Petropoulos11-Jun-04 3:37 
GeneralRe: IO completion ports and unexpected performance. Pin
Angelos Petropoulos11-Jun-04 5:29
Angelos Petropoulos11-Jun-04 5:29 
GeneralRe: IO completion ports and unexpected performance. Pin
Colby James Smith1-Sep-04 10:06
Colby James Smith1-Sep-04 10:06 
Questionwhat is the differcence between close and dispose with Process instance? Pin
fu09-Jun-04 2:36
fu09-Jun-04 2:36 
AnswerRe: what is the differcence between close and dispose with Process instance? Pin
Heath Stewart9-Jun-04 2:54
protectorHeath Stewart9-Jun-04 2:54 
GeneralRe: what is the differcence between close and dispose with Process instance? Pin
fu09-Jun-04 16:52
fu09-Jun-04 16:52 
GeneralRe: what is the differcence between close and dispose with Process instance? Pin
Heath Stewart10-Jun-04 3:09
protectorHeath Stewart10-Jun-04 3:09 
AnswerRe: what is the differcence between close and dispose with Process instance? Pin
Alvaro Mendez9-Jun-04 8:45
Alvaro Mendez9-Jun-04 8:45 
GeneralCrystal Report and Dataset Pin
amatyasik9-Jun-04 2:00
amatyasik9-Jun-04 2:00 
GeneralRe: Crystal Report and Dataset Pin
Heath Stewart9-Jun-04 2:14
protectorHeath Stewart9-Jun-04 2:14 
GeneralRe: Crystal Report and Dataset Pin
Alex Getman9-Jun-04 7:00
Alex Getman9-Jun-04 7:00 
General. Pin
hssaroch9-Jun-04 1:40
hssaroch9-Jun-04 1:40 
GeneralRe: FTP and Telnet client class in C# Pin
Heath Stewart9-Jun-04 2:51
protectorHeath Stewart9-Jun-04 2:51 
AnswerRe: FTP and Telnet client class in C# Pin
sudreshan_116-Jul-09 1:08
sudreshan_116-Jul-09 1:08 
QuestionUSB port programming?? Pin
EdgarBM9-Jun-04 1:26
EdgarBM9-Jun-04 1:26 
AnswerRe: USB port programming?? Pin
Heath Stewart9-Jun-04 2:44
protectorHeath Stewart9-Jun-04 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.