Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set NuGet's maxHttpRequestsPerSource setting to a reasonable value for Linux #9787

Open
3 of 13 tasks
pjquirk opened this issue May 3, 2024 · 1 comment
Open
3 of 13 tasks

Comments

@pjquirk
Copy link

pjquirk commented May 3, 2024

Description

We've seen at least one occurrence of connection limits being hit during dotnet restore on a Linux larger runner, though impact could be larger. According to the documentation (see emphasis):

maxHttpRequestsPerSource
Controls the maximum number of parallel requests sent from NuGet to every package source for package dependency resolution and downloads. The default value on dotnet.exe is Int32.MaxValue which is derived from HttpClientHandler.MaxConnectionsPerServer property. This setting has no impact on dotnet.exe for Mac OS because the throttling limit is set to 16 to avoid too many open files error. The default value for NuGet client tools that runs on .NET Framework such as Visual Studio and nuget.exe is 64 on Windows and 1 on Mono. The default value for Packages.config style projects is set to Environment.ProcessorCount. Configuring maxHttpRequestsPerSource property to a value less than the default could impact NuGet performance.

For larger projects this can result in intermittent connection timeouts as the VM can no longer connect to the pool's load balancer (which is restricted to 1024 connections from an individual VM). Some examples from other software:

We could just use the same limit as Windows of 64 or Mac of 16, there's no real heuristic for it other than not being "unlimited".

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

All current Linux images

Is it regression?

No

Expected behavior

Limited connections being made from nuget restore and dotnet restore on Linux, which lessens chance of intermittent connection timeouts.

Actual behavior

Projects with many packages on the same source can have intermittent connection timeouts.

Repro steps

N/A

@erik-bershel
Copy link
Contributor

Hey @pjquirk!
We'll take a look ASAP. Thank you for bringing it into our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants