Page 1 of 1

Handbrake causing ping instability

Posted: Wed Jan 13, 2021 5:18 pm
by Moonchips
Description of problem or question:
There seems to be a direct correlation between encoding using Handbrake and unstable ping on my system. When I start encoding, pings to my router (which should be <1ms) jump between 5-25 ms. After months of susing out the situation I found that it is Handbrake causing the issue when the process priority limit is set to "Normal" or above. The issue magically fixes itself when I set Handbrake below normal priority.

This sounds like an off-the-wall problem, as I can't figure out how Handbrake could possibly have any effect on network performance. Hence I am here asking for theories/solutions that don't require me to limit the process. Any help would be appreciated. :)

Handbrake is only using 60% of my CPU while encoding 1080p x265, 28 RF slow mode. (Though I've found quality settings never make any difference)

CPU: Threadripper 1950x 16-core
Memory: 64GB 2133 Mhz DDR4
Disk: SSD Samsung 850 EVO 250GB

The source file is located on a standard high performance HDD and the destination file is located on the above mentioned SSD.

Steps to reproduce the problem (If Applicable):

Start encoding any resolution video file using x265, at any quality (I'm using between 28-26) constant with Handbrake set to normal process priority.

HandBrake version (e.g., 1.0.0):

1.3.3 (2020061300)

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 Pro, Version 20H2 build 19042.685

HandBrake Activity Log ***required*** (see How-to get an activity log)

(log file too big for forum post)

https://pastebin.com/bLzCkSFR

Code: Select all

https://pastebin.com/bLzCkSFR

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 5:52 pm
by mduell
Sounds like the network driver is running at normal or lower priority, so the OS scheduler splits time between HB and the network driver.

Not a HB issue.

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 5:59 pm
by s55
Could be a number of things so I'll make a few point thoughts:

First, I'd note that "60%" utilisation is more of a guidance. A cpu has many resources internally so you don't necessarily see the full picture of what is going on in the chip by looking at task manager. Outside the CPU itself, memory bandwidth, cache sizes/bandwidth, io bandwidth etc can all be having an impact on performance as well. Even internally in the OS, there may be bottlenecks or issues.

Second, Threadrippers are complex multi-chip[let] beasts. There is a complex NUMA memory setup that introduces some complexities in how windows schedules processes and threads onto the CPU. I'd make an educated guess that your issue is probably related to this.

HandBrake by default, actually sets "Below Normal" on windows to allow the system to be a bit more responsive to user actions while HB is running. Some users historically didn't understand that running a complex load can make a machine extremely sluggish (although this is typically only seen on low end machines) I'd say, if "Below Normal" works in this case, best to leave it there. It doesn't really impact performance unless your doing other things on the system, particularly other heaver loads.

Third, it could well be an issue with one or more of the drivers, the way they interact with windows and or hardware interrupts. Maybe worth checking everything is up-to-date on the off chance it helps.

Unless your really in-depth on this stuff, you probably will find it hard to get an exact answer to this but this would be my educated guess.

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 6:41 pm
by musicvid
It's not Handbrake.
ANY computationally-intense CPU activity competes with and reduces the ability to send and receive bidirectional network packets. It has always been that way. For instance, ANY nonlinear editor has exactly the same effect during encoding.

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 6:47 pm
by Moonchips
s55 wrote: Wed Jan 13, 2021 5:59 pm

HandBrake by default, actually sets "Below Normal" on windows to allow the system to be a bit more responsive to user actions while HB is running. Some users historically didn't understand that running a complex load can make a machine extremely sluggish (although this is typically only seen on low end machines) I'd say, if "Below Normal" works in this case, best to leave it there. It doesn't really impact performance unless your doing other things on the system, particularly other heaver loads.
I had no idea HandBrake had that default. I don't remember ever changing it until today. I'll leave that setting at the default then.
mduell wrote: Wed Jan 13, 2021 5:52 pm Sounds like the network driver is running at normal or lower priority, so the OS scheduler splits time between HB and the network driver.

Not a HB issue.
Do you know if there is a way to check this and/or modify the setting?

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 6:56 pm
by Woodstock
Is drive E a local or a mapped network drive?

Do you see differences in ping times between other machines and the router when handbrake is running?

Re: Handbrake causing ping instability

Posted: Wed Jan 13, 2021 7:34 pm
by Moonchips
Woodstock wrote: Wed Jan 13, 2021 6:56 pm Is drive E a local or a mapped network drive?

Do you see differences in ping times between other machines and the router when handbrake is running?
E is a local drive. A ping test on any device on the network yields the same result. I've also checked those devices individually to make sure the problem wasn't on their end. My Plex server doesn't seem to have this issue when transcoding videos, so maybe it is a windows thing?