[Solved, sort of] I need help keeping the BITS service running until it isn't needed

Discussion in 'Windows 11' started by pf100, Feb 25, 2022.

  1. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #1 pf100, Feb 25, 2022
    Last edited: Feb 25, 2022
    Edit: I'm just going to do a net start and let it stop when it wants to.
    In a project I'm doing I need to keep BITS running until I'm done with it. From what I understand processes beyond my control can stop BITS at any time and they often do. How can I force it to stay running until it's no longer needed? I was thinking of doing something like the code below, and I will if I have to, but it seems a bit janky and if it stops and then is immediately restarted it can still cause issues. Any help would be appreciated.
    Code:
    :loop
    net start BITS
    timeout /t 10
    goto loop
     
  2. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    BITS really does that itself by design, the B in BITS means it takes a backseat when power management kicks in or there are foreground tasks.
    Store (specially the new Store) rather uses it's own transfer api, not BITS!
    Windows updates are often not using BITS either, or even wuauserv. There are even more alternative routes than MoUsoCoreWorker now.
    There's all the Windows Feature Experience & Online Service Experience & other hidden Packs, also not necessarily using BITS, but undocumented routes like a trojan (WNF & co).
    The freaking delivery optimization makes everything about windows updates worse, and it's not enough to just turn it off in the settings or disable it's service.
    So if you found waking up BITS is helping, I don't see why not use it. Can't make things worse than they are.

    You should use a task schedule instead of brute-force script as to not cause stutters when the system is overwhelmed.
    Even decent systems get overwhelmed when windows update moves half a million files and 50k folders around needlessly
    and uses single-threaded s**tty differential compression on top of mixed lzms and lzx compression and awfully bloated xml scripts.
    No such issues before the 20xx versions. Not a gazillion of "remediation" services and SSUs either.
    The future looks grim, WaaS end-game scenario is being pushed aggressively, like 20 years earlier.
    Pluton chip is one thing. I'm thinking Pluton 2.0+, always connected chip, but not to your network. To a global satellite one.
    Eh, cross that bridge when we come to it. Used to think it won't be the case in my lifetime, now - not so sure anymore.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    #3 pf100, Feb 26, 2022
    Last edited: Feb 26, 2022
    (OP)
    @BAU Fun fact: if you remove the timeout from the script in the OP it'll use ~5% CPU (as reported by task manager) on a current gen CPU. With a 1 second timeout it uses ~0.5%. With a 10 second timeout it's about ~0.1%

    Also, I'm hearing rumors that they're working on windows 12 and it'll be mostly written from the ground up. Will that include the update subsystem? Who knows? As you said, it's already morphing into something else anyway and that's what's causing the weird issues that running BITS seems to help fix, sort of. I'm sure that isn't a fix that directly addresses the issue though. I just throw stuff at the wall and see what sticks. I'll never know exactly how all of this works anyway.
     
  4. AveYo

    AveYo MDL Expert

    Feb 10, 2009
    1,836
    5,685
    60
    Do consider cmd stuff is blocking, unlike a scheduled task. That 5% - even 0.5% could turn effectively into more when the system is 100% already.

    I don't believe any resource is given atm to something like "12" - that really was trolling.

    BITS waking up helping is not a shocker for me. Just like having an explorer window open. Or Task Manager.
    Windows is so complex (as in, carrying over decades of baggage) that even they don't know why is what with the source code in front of them.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    I edited my previous post to mention that those percentages are what task manager reports.
    My guess is that it's a much higher spike than what is reported and is probably something more like the average of, "X millisecond high percentage spike followed by X amount of time doing nothing."
    That's assuming it takes fast enough samples to accurately read the spikes in the first place.
    So a 75% spike followed by doing nothing could be reported anywhere from 0.1% to 75%, for instance.