[PR #9991] server: Improve download reliability in bandwidth-constrained environments. #75408

Open
opened 2026-05-05 07:50:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9991
Author: @monolith-jaehoon
Created: 3/26/2025
Status: 🔄 Open

Base: mainHead: feature-reduce_stall


📝 Commits (2)

  • e306d8e server: Improve download reliability in bandwidth-constrained environments.
  • bfd79d1 server: download: replace mutax to atomic.Value

📊 Changes

1 file changed (+18 additions, -16 deletions)

View changed files

📝 server/download.go (+18 -16)

📄 Description

Currently, the code is designed to download 16 parts separately, maintaining an individual lastUpdated timestamp for each part. If 30 seconds pass from the lastUpdated timestamp, a timeout occurs.

In network environments with QoS restrictions or traffic limitations, only a few of the 16 parts actively transmit while the others remain stalled. When a stalled part times out, it immediately retries, which unintentionally disrupts the transmission of parts that were previously downloading successfully. As a result, the available bandwidth keeps shifting between parts, preventing steady progress and causing the pull process to stall.

To address this issue, I modified the logic so that when a part encounters a connection timeout, it will wait until the currently active parts complete their transmission before retrying. This prevents unnecessary retries from competing for bandwidth and ensures a more stable and predictable download process.

Additionally, I reduced the stall timeout from 30 seconds to 5 seconds to minimize download idle time.

I believe this change could help address issues like https://github.com/ollama/ollama/issues/8484, https://github.com/ollama/ollama/issues/8406, and https://github.com/ollama/ollama/issues/8330.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9991 **Author:** [@monolith-jaehoon](https://github.com/monolith-jaehoon) **Created:** 3/26/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature-reduce_stall` --- ### 📝 Commits (2) - [`e306d8e`](https://github.com/ollama/ollama/commit/e306d8e032347bc760e8e0fdecb763debf284fab) server: Improve download reliability in bandwidth-constrained environments. - [`bfd79d1`](https://github.com/ollama/ollama/commit/bfd79d152beaace2b52be08600f9ccd53d819f3f) server: download: replace mutax to atomic.Value ### 📊 Changes **1 file changed** (+18 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `server/download.go` (+18 -16) </details> ### 📄 Description Currently, the code is designed to download 16 parts separately, maintaining an individual lastUpdated timestamp for each part. If 30 seconds pass from the lastUpdated timestamp, a timeout occurs. In network environments with QoS restrictions or traffic limitations, only a few of the 16 parts actively transmit while the others remain stalled. When a stalled part times out, it immediately retries, which unintentionally disrupts the transmission of parts that were previously downloading successfully. As a result, the available bandwidth keeps shifting between parts, preventing steady progress and causing the pull process to stall. To address this issue, I modified the logic so that when a part encounters a connection timeout, it will wait until the currently active parts complete their transmission before retrying. This prevents unnecessary retries from competing for bandwidth and ensures a more stable and predictable download process. Additionally, I reduced the stall timeout from 30 seconds to 5 seconds to minimize download idle time. I believe this change could help address issues like https://github.com/ollama/ollama/issues/8484, https://github.com/ollama/ollama/issues/8406, and https://github.com/ollama/ollama/issues/8330. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 07:50:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#75408