[GH-ISSUE #12657] Ollama on Windows spawns a new netsh process every 5 seconds #70458

Closed
opened 2026-05-04 21:37:18 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @lowleveldesign on GitHub (Oct 16, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12657

Originally assigned to: @BruceMacD on GitHub.

What is the issue?

I observed that on Windows ollama spawn a new netsh process every 5 seconds. Is this really necessary? Is there a way to disable that behavior?

Example wtrace output (you may do the same test with procmon):

 wtrace --handlers process -f 'pname ~ netsh' -f 'pname ~ svchost' -f 'name ~ PROCESS'

...
14:36:59.0928 netsh (26132.-1) Process/Start command line: 'netsh interface show interface'
14:36:59.2548 svchost (8940.-1) Process/Start command line: 'C:\Windows\System32\svchost.exe -k netsvcs -p -s NetSetupSvc'
14:37:04.0905 netsh (14040.-1) Process/Start command line: 'netsh interface show interface'
14:37:04.2606 svchost (13440.-1) Process/Start command line: 'C:\Windows\System32\svchost.exe -k netsvcs -p -s NetSetupSvc'
...

│ ├─ ollama app [11608]
│ │ ├─ ollama [9460]
│ │ │ ├─ conhost [17416]
│ │ │ ├─ ollama [23316]
│ │ │ │ ├─ conhost [24720]
│ │ ├─ netsh [26132] started at 14:36:59.0928  finished at 14:36:59.3321
│ │ │ ├─ conhost [21976] started at 14:36:59.1043  finished at 14:36:59.3359
│ │ ├─ netsh [14040] started at 14:37:04.0905  finished at 14:37:04.3369
│ │ │ ├─ conhost [19532] started at 14:37:04.1021  finished at 14:37:04.3402

Thanks!

Relevant log output


OS

Windows

GPU

No response

CPU

No response

Ollama version

0.12.5

Originally created by @lowleveldesign on GitHub (Oct 16, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12657 Originally assigned to: @BruceMacD on GitHub. ### What is the issue? I observed that on Windows ollama spawn a new netsh process every 5 seconds. Is this really necessary? Is there a way to disable that behavior? Example [wtrace](https://github.com/lowleveldesign/wtrace) output (you may do the same test with procmon): ```sh wtrace --handlers process -f 'pname ~ netsh' -f 'pname ~ svchost' -f 'name ~ PROCESS' ... 14:36:59.0928 netsh (26132.-1) Process/Start command line: 'netsh interface show interface' 14:36:59.2548 svchost (8940.-1) Process/Start command line: 'C:\Windows\System32\svchost.exe -k netsvcs -p -s NetSetupSvc' 14:37:04.0905 netsh (14040.-1) Process/Start command line: 'netsh interface show interface' 14:37:04.2606 svchost (13440.-1) Process/Start command line: 'C:\Windows\System32\svchost.exe -k netsvcs -p -s NetSetupSvc' ... │ ├─ ollama app [11608] │ │ ├─ ollama [9460] │ │ │ ├─ conhost [17416] │ │ │ ├─ ollama [23316] │ │ │ │ ├─ conhost [24720] │ │ ├─ netsh [26132] started at 14:36:59.0928 finished at 14:36:59.3321 │ │ │ ├─ conhost [21976] started at 14:36:59.1043 finished at 14:36:59.3359 │ │ ├─ netsh [14040] started at 14:37:04.0905 finished at 14:37:04.3369 │ │ │ ├─ conhost [19532] started at 14:37:04.1021 finished at 14:37:04.3402 ``` Thanks! ### Relevant log output ```shell ``` ### OS Windows ### GPU _No response_ ### CPU _No response_ ### Ollama version 0.12.5
GiteaMirror added the bug label 2026-05-04 21:37:18 -05:00
Author
Owner

@Eason023 commented on GitHub (Oct 17, 2025):

@lowleveldesign Hi! I’d like to try to work on this issue.
Plan: add a small throttle/backoff so that netsh isn’t run every 5s on Windows (run only on state-change or with at least a 60s interval), plus an opt-out env var (OLLAMA_DISABLE_NETSH_POLL=1) and a debug log for verification.
If maintainers have a preferred interval or mechanism, I’m happy to adjust.

<!-- gh-comment-id:3413885996 --> @Eason023 commented on GitHub (Oct 17, 2025): @lowleveldesign Hi! I’d like to try to work on this issue. **Plan:** add a small throttle/backoff so that `netsh` isn’t run every 5s on Windows (run only on state-change or with at least a 60s interval), plus an opt-out env var (`OLLAMA_DISABLE_NETSH_POLL=1`) and a debug log for verification. If maintainers have a preferred interval or mechanism, I’m happy to adjust.
Author
Owner

@levicki commented on GitHub (Oct 17, 2025):

This other bug is related (reports the behavior of svchost.exe launching netsetupsvc):
https://github.com/ollama/ollama/issues/12510

Plan: add a small throttle/backoff so that netsh isn’t run every 5s on Windows

What is the purpose of executing this netsh polling anyway?

If I am not mistaken, Go uses Windows' native way of querying interfaces?

I am not a maintainer and I was unable to locate the offending code in this repo, but to me it looks like a hack, so I don't agree it should be just throttled and/or worked around but actually implemented correctly if possible and removed alltogether if not.

<!-- gh-comment-id:3415144355 --> @levicki commented on GitHub (Oct 17, 2025): This other bug is related (reports the behavior of svchost.exe launching netsetupsvc): https://github.com/ollama/ollama/issues/12510 > Plan: add a small throttle/backoff so that netsh isn’t run every 5s on Windows What is the purpose of executing this netsh polling anyway? If I am not mistaken, Go uses Windows' native way of querying interfaces? I am not a maintainer and I was unable to locate the offending code in this repo, but to me it looks like a hack, so I don't agree it should be just throttled and/or worked around but actually implemented correctly if possible and removed alltogether if not.
Author
Owner

@BruceMacD commented on GitHub (Oct 21, 2025):

Thanks for bringing this my attention, this code was originally added to try to figure out why models were not responding sometimes in the app. My suspicion was that it was something to do with not being able to download the models back then. I've removed this code for the next release.

<!-- gh-comment-id:3428355915 --> @BruceMacD commented on GitHub (Oct 21, 2025): Thanks for bringing this my attention, this code was originally added to try to figure out why models were not responding sometimes in the app. My suspicion was that it was something to do with not being able to download the models back then. I've removed this code for the next release.
Author
Owner

@lowleveldesign commented on GitHub (Oct 22, 2025):

Awesome! Thank you, @BruceMacD.

<!-- gh-comment-id:3430730983 --> @lowleveldesign commented on GitHub (Oct 22, 2025): Awesome! Thank you, @BruceMacD.
Author
Owner

@levicki commented on GitHub (Oct 30, 2025):

Thanks for bringing this my attention, this code was originally added to try to figure out why models were not responding sometimes in the app. My suspicion was that it was something to do with not being able to download the models back then. I've removed this code for the next release.

I am not seeing this referenced in the commit in 0.12.7 release, did you actually remove it?

<!-- gh-comment-id:3468978771 --> @levicki commented on GitHub (Oct 30, 2025): > Thanks for bringing this my attention, this code was originally added to try to figure out why models were not responding sometimes in the app. My suspicion was that it was something to do with not being able to download the models back then. I've removed this code for the next release. I am not seeing this referenced in the commit in 0.12.7 release, did you actually remove it?
Author
Owner

@BruceMacD commented on GitHub (Oct 30, 2025):

@levicki the app commits aren't in the main repo commit history (yet), so it won't show up there

<!-- gh-comment-id:3469025196 --> @BruceMacD commented on GitHub (Oct 30, 2025): @levicki the app commits aren't in the main repo commit history (yet), so it won't show up there
Author
Owner

@levicki commented on GitHub (Oct 30, 2025):

@levicki the app commits aren't in the main repo commit history (yet), so it won't show up there

Ok, but was this issue fixed or pushed back to some other release? How do we know except by staring at task manager to see if svchost.exe keeps appearing and disappearing every 5 seconds?

<!-- gh-comment-id:3469265480 --> @levicki commented on GitHub (Oct 30, 2025): > [@levicki](https://github.com/levicki) the app commits aren't in the main repo commit history (yet), so it won't show up there Ok, but was this issue fixed or pushed back to some other release? How do we know except by staring at task manager to see if svchost.exe keeps appearing and disappearing every 5 seconds?
Author
Owner

@lowleveldesign commented on GitHub (Oct 31, 2025):

I tested the latest release (v0.12.7) and it no longer starts netsh processes. So the reported problem is fixed.

<!-- gh-comment-id:3471739522 --> @lowleveldesign commented on GitHub (Oct 31, 2025): I tested the latest release (v0.12.7) and it no longer starts netsh processes. So the reported problem is fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#70458