[PR #1916] [MERGED] download: add inactivity monitor #21263

Closed
opened 2026-04-19 15:33:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1916
Author: @mxyng
Created: 1/11/2024
Status: Merged
Merged: 1/26/2024
Merged by: @mxyng

Base: mainHead: mxyng/inactivity-monitor


📝 Commits (1)

  • 27331ae download: add inactivity monitor

📊 Changes

1 file changed (+74 additions, -43 deletions)

View changed files

📝 server/download.go (+74 -43)

📄 Description

If a download part is inactive for some time, restart it. From profiling, it's possible for one or more of the download parts to stall and receive no content from the storage backend for many consecutive seconds.

This generally causes the download to slow to a rate of near zero at the end as other, faster parts complete their download.

This change adds a monitor for each part. If the part doesn't receive data (0 bytes) for a given window (5 seconds), the monitor will trigger a stall error and the request is interrupted and retried. This retry does not increment the retry counter.

Related to #1736


🔄 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/1916 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 1/11/2024 **Status:** ✅ Merged **Merged:** 1/26/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/inactivity-monitor` --- ### 📝 Commits (1) - [`27331ae`](https://github.com/ollama/ollama/commit/27331ae3a8fa3d5fba2a4b7105c18eed10f5b8af) download: add inactivity monitor ### 📊 Changes **1 file changed** (+74 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `server/download.go` (+74 -43) </details> ### 📄 Description If a download part is inactive for some time, restart it. From profiling, it's possible for one or more of the download parts to stall and receive no content from the storage backend for many consecutive seconds. This generally causes the download to slow to a rate of near zero at the end as other, faster parts complete their download. This change adds a monitor for each part. If the part doesn't receive data (0 bytes) for a given window (5 seconds), the monitor will trigger a stall error and the request is interrupted and retried. This retry does _not_ increment the retry counter. Related to #1736 --- <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-04-19 15:33:05 -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#21263