How do we improve the performance of conhost processes when we ping a bunch of servers?
A customer had a program that launches many instances of the
ping program in order to check the availability of a large number of servers. They found that each copy of
ping comes with a copy of conhost.exe, and all these
conhost processes degrade system performance by a factor of four. They were looking for guidance on how they could improve the performance of the
Well, the best way to avoid performance issues with
conhost is to stop using
It sounds like the customer was launching the
ping program and then either parsing the output or studying the exit code in order to determine whether the server was up. Instead, they could use the
System.Net.NetworkInformation.Ping class (if programming in C#) or the IcmpSendEcho function (if programming in C/C++). Not only is this more efficient, you get detailed status results which will help you decide which server your program should use.
(Both functions report the ping time in milliseconds because the speed of light is unlikely to improve.)