better logging / fix defaults

This commit is contained in:
jmorganca 2025-12-20 21:05:34 -08:00
parent 49393385ca
commit ebbebdf3b1
1 changed files with 5 additions and 6 deletions

View File

@ -133,11 +133,11 @@ func (p *blobDownloadPart) UnmarshalJSON(b []byte) error {
} }
var ( var (
downloadPartSize = int64(getEnvInt("OLLAMA_DOWNLOAD_PART_SIZE", 64)) * format.MegaByte downloadPartSize = int64(envInt("OLLAMA_DOWNLOAD_PART_SIZE", 64)) * format.MegaByte
downloadConcurrency = getEnvInt("OLLAMA_DOWNLOAD_CONCURRENCY", 32) downloadConcurrency = envInt("OLLAMA_DOWNLOAD_CONCURRENCY", 48)
) )
func getEnvInt(key string, defaultVal int) int { func envInt(key string, defaultVal int) int {
if s := os.Getenv(key); s != "" { if s := os.Getenv(key); s != "" {
if v, err := strconv.Atoi(s); err == nil { if v, err := strconv.Atoi(s); err == nil {
return v return v
@ -430,11 +430,10 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
spread := dlPct - hPct spread := dlPct - hPct
spreadBytes := downloaded - hashed spreadBytes := downloaded - hashed
msg := fmt.Sprintf("progress: downloaded %d%% | hashed %d%% | spread %d%%", dlPct, hPct, spread) slog.Debug(fmt.Sprintf("progress: downloaded %d%% | hashed %d%% | spread %d%%", dlPct, hPct, spread))
if spreadBytes > pageCacheWarningBytes { if spreadBytes > pageCacheWarningBytes {
msg += fmt.Sprintf(" [WARNING: %.1fGB ahead, page cache pressure]", float64(spreadBytes)/(1<<30)) slog.Debug("page cache pressure", "ahead", fmt.Sprintf("%.1fGB", float64(spreadBytes)/(1<<30)))
} }
slog.Info(msg)
case <-progressDone: case <-progressDone:
return return
} }