none
The minimal sampling rate of perfmon is 1 second, why? RRS feed

  • General discussion

  • Hi, All:

        why the minimum sampling interval used by perfmon is always 1 second, why can't the sample interval be smaller? for example, 100 miliseconds.

        If I want to gather the performance counters at a smaller sampling rate, for example, 100 miliseconds, how could I do that. Currently, what I could think of is to use the sample code at http://msdn.microsoft.com/en-us/library/windows/desktop/aa373178(v=vs.85).aspx, and modify the sleeping time between each sampling. Will that bring negative impact to performance? 

        Studying the sample code (Microsoft SDKs\Windows\v7.1\Samples\winbase\winnt\perftool\perfdlls) of Windows SDK, I think the major overhead when gathering the performance counters are:

         (1) allocating a buffer,  memset to 0

         (2) fill in the allocated buffer with a pre-defined format of  counter definitions & counter value blocks, the operation includes memcpy counter definition to the buffer.

        Considering above costs,  Supposing that I only gather a counter defined by myself,  will sampling rate of 100 miliseconds really be a big concern to the overall performance?

        Is there any other ways to gather performance counters at a smaller sampling rate?


    • Edited by xlzhang Friday, October 19, 2012 5:22 PM
    Friday, October 19, 2012 4:13 PM