Eliminating latency issues in Windows (1 Viewer)

doveman

Portal Pro
February 12, 2008
2,326
178
Home Country
United Kingdom United Kingdom
I've had problems with high interrupt-to-process latency (as measured by LatencyMon) before and got somewhere but never really eliminated them as I recall. I'm trying to setup a system for my brother and so I'm trying to eliminate them on that now (although I have the same problem on my gaming system, I'm focusing on getting my brother's system sorted for now, so that I can give it to him).

I'll copy the e-mail I sent to the author of LatencyMon, which covers what I'm having problems with.

"I'm having an issue with LatencyMon reporting very high spikes, which may be connected to HDD writing but I'm not sure. If I Analyse in CCleaner, no spikes but when I run the Wipe, they appear, which makes me think they're related to writing and not reading.

When I launch Iron Portable it seems to generate a spike (3500us) just as it's finished opening all the saved tabs, so perhaps it does some writing at that point. Then again, if I open a new tab and browse to a new page, that obviously writes cache files and doesn't generate a spike. Opera Portable also generates a spike of around 1100us just as it finishes loading. Sometimes IE, which only opens with one tab, does and other times it doesn't generate a spike, whether I'm running in Balanced or High Performance mode. I get the odd spike to 600-700us with various apps but that's below the threshold to trigger LatencyMon's warning, so they probably don't matter.

Even in High Performance mode, opening MediaPortal generates several spikes from 1500us to 3908us. On the second launch, it hit 20874us and then 9000us. Even if I restart LatencyMon after MediaPortal has loaded, it spikes to around 2000us several times.

I tend to see storport.sys listed for highest ISR and DPC, although sometimes ISR changes to ndis.sys or tcpip.sys and DPC changes to amd_sata.sys. Generally the numbers reported are no higher at the time of a latency spike than they are before or after though (but not always as the following shows). After running for a minute at idle, ISR is storport.sys at 28.68us and DPC is ntoskrnl.exe at 87us (with no latency spikes in that time). However, as soon as I launch MediaPortal, DPC changes to storport.sys at 239us and then ISR shows 207us for storport.sys and I get a latency spike of 9335us.

Strangely, if I run DPC Latency Checker with Iron open, the highest spike is 168us over several minutes. If I close DPC-LC and start LatencyMon however, I get a spike of 758us within 10s. Likewise with launching MediaPortal, the highest spike DPC-LC shows is 159us. I'm not sure if DPC-LC is just sampling at a lower interval than LatencyMon and missing the spikes or if there's some incompatibility with LatencyMon and my system that's causing it to show phantom latency spikes."


The first reply I received said

"The interrupt-to-latency test is only meaningful without having any other programs running in the background."

to which I replied

"You say it's only meaningful without having any other programs running but my concern is that if I'm getting high latency spikes when certain activity happens, such as writing to disk, then these spikes are going to cause issues with audio/video when this activity happens whilst using A/V software, gaming, etc."

and he replied

"The interrupt-to-latency monitor simulates a critical audio process. This is why it is not recommended to be running any other activity on top.

That said, if you would like to paste the contents of the report view in a message, we don’t mind to take a look to see if there is anything peculiar in your system."

So I sent him three reports, one at idle, one launching Iron and one launching Mediaportal


and he replied

"Your system appears to be OK. Regarding excessive hard disk usage and spikes under load, I suggest you make sure that your harddisks have enough free space and are not fragmented. You can use the standard Windows defragmentation tool for that. If fragmentation on your system is low and not a problem then I suggest considering if excessive paging might be the problem (take a look at your memory load, kill of processes that consume a lot of memory, etc.)"

My HDDs are defragged and have plenty of space, so that's not an issue. I also told him that I see tons of hard pagefaults from svchost.exe when analysing the disk with Windows defrag but no latency spikes and he replied



"Whether they are connected depends on the priority of the process that incurs the page fault. Defrag runs at lower or idle priority. In principle, only a real-time priority process/thread can compete and thus influence the interrupt to process latency measurements."

Which makes sense, although it doesn't get me any nearer to understanding why I'm getting latency spikes with MediaPortal, where it does matter as that's for playing media and having spikes could cause audio/video glitches.


So has anyone got this problem sussed or do you all just leave LatencyMon well alone and live in blissful ignorance ;)
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,578
    8,228
    Home Country
    New Zealand New Zealand
    So has anyone got this problem sussed or do you all just leave LatencyMon well alone and live in blissful ignorance ;)
    ^^This! :D

    ...where it does matter as that's for playing media and having spikes could cause audio/video glitches.
    I don't go looking for problems unless there is actually a problem. That is probably not helpful to you but its the truth.


    FYI to other people reading, there is some history:
    https://forum.team-mediaportal.com/threads/windows-7-dpc-latency-spikes.104320/
     

    doveman

    Portal Pro
    February 12, 2008
    2,326
    178
    Home Country
    United Kingdom United Kingdom
    You've probably got the right approach mm ;)

    I'm probably more obsessed with this at the moment than I should be, because this is a system I'm building for my brother (note that my other thread was about a different system) and once I've sent it to him, it's going to be next to impossible to check things like latency over the Net using TeamViewer. In some ways, it's perhaps easier to check for and eliminate latency issues (in theory anyway) than to test every possible scenario to see if there's any audio/video glitches and if I've ensured there are no latency issues and my brother reports that he's experiencing glitches, at least I'll know it's not that and can look at settings/codecs, etc.

    I'm not sure at the moment whether LatencyMon is just showing phantom readings though. If not, it would seem to suggest that DPC Latency Checker is pretty useless as it's not showing any of the latency spikes that LatencyMon is, so anyone just using that would think there is no latency problem and any issues they're having must be due to something else. On the other hand, if LatencyMon is only meant to be used with nothing else running, as the author initially suggested, then it's not much use for establishing whether any programs/activity are triggering latency spikes and DPC Latency Checker is probably more useful if there's no such restrictions with it.
     

    Users who are viewing this thread

    Top Bottom