loic-sharma / BaGet

A lightweight NuGet and symbol server
https://loic-sharma.github.io/BaGet/
MIT License
2.62k stars 680 forks source link

Parallel Package Registration Question #553

Open Smorgan05 opened 4 years ago

Smorgan05 commented 4 years ago

What is the max number of parallel registration threads I can throw at the server? Is there a rate limiter in place? Also is the registration parallel safe?

Optimal would be to have 10 to 20 parallel tasks going at once.

Also Here's a new PowerShell scrip that uses the Parallel Foreach for the main page:

$SafeList = [System.Collections.Concurrent.ConcurrentBag[string]]::New()
// Populate SafeList from List
$SafeList | ForEach-Object -Parallel {
nuget push here
} -ThrottleLimit 10
loic-sharma commented 4 years ago

Is there a rate limiter in place?

There is no rate limiting.

Also is the registration parallel safe?

What do you mean by registration here? The NuGet V3 protocol has a package metadata API that is also referred to as the "registration" API. This is fully concurrent and can be accessed in parallel.

As for package uploads, concurrent uploads should work. Please let me know if you run into bugs or errors, I'll fix those up!

Also Here's a new PowerShell scrip that uses the Parallel Foreach for the main page:

Thanks for sharing! By the way, you can also use nuget.exe push *.nupkg or dotnet nuget push "*.nupkg" to push multiple packages using the regular NuGet client.