-
Notifications
You must be signed in to change notification settings - Fork 252
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
(Future?) performance issue with the NuGet v3 protocol in NuGet client #4448
Comments
Awesome detail. Would you consider posting average daily bandwidth egress before and after the fix? That would be interesting. |
Would be very interesting indeed :-) Will try to capture that. |
Fix on MyGet has been deployed. We did observe a few things (@rrelyea / @emgarten):
|
Related to #8478 which is tackling search resource changes. This is an effective dup of #8058. |
Lowering the priority here. |
Based on https://github.com/dotnet/corefx/issues/11100#issuecomment-275857983, which describes a Visual Studio (and command line NuGet.exe) crash when installing
System.Net.Http 4.4.0-beta-24913-021
fromhttps://dotnet.myget.org/F/dotnet-core/api/v3/index.json
, we (MyGet) found a (Future?) performance issue with the NuGet v3 protocol in NuGet client.At the time of writing this issue, at MyGet we don't implement server-side paging for V3 registrations. In other words, a URL like
https://dotnet.myget.org/F/dotnet-core/api/v3/registration1/system.net.http/index.json
could potentially return 25 MB of JSON data which the client has to parse.Dependencies may have such big metadata sizes as well. All in all, NuGet.exe (and NuGet in VS) consume over 500 MB of memory at a given point in this restore, essentially slowing down the machine tremendously. The install works (if your machine has enough memory), but takes a while.
Obviously, that is an issue that can be fixed on the server-side (at MyGet we will be deploying a fix after the weekend, on Feb 6, 2017), but it could occur in the future with packages on NuGet.org that have many different versions (think FAKE, RavenDB.Client, ...). Consider this issue not-super-urgent, but as something to look at while NuGet is gaining more and more traction.
The more versions of a package exist, the more likely this will happen for that package. Paging will go a while to circumvent this, but it may be knocking on NuGet's door at some point...
Environment
We tested this issue with Visual Studio 2015 + NuGet 3.5 extension, as well as NuGet.exe 3.5.0.1996.
Repro
As we are fixing MyGet to page results, there is no "live" repro. Nevertheless we have mirrored all downloaded metadata files so a restore should be possible using this point-in-time copy of URLs:
NuGet.exe install System.Net.Http -Version 4.4.0-beta-24913-02 -Verbosity Detailed -Source https://stagingmyget.blob.core.windows.net/repro/index.json
Installing this package in VS2015 leads to VS crashing (most probably due to an out of memory condition, but we did not investigate this further).
Restore/install logs are meaningless: download speeds are normal, parsing in the client is taking excessive time (and is not visible in the logs). We do have some other supporting data, see below.
Supporting data
We have also uploaded a memory profiling dump (using JetBrains dotMemory) where the excessive memory usage and traffic is very visible.
Workspace export (which captured all allocations) is available at: NuGet-Install-Memory-Usage.dmw
A Fiddler request log of our initial investigation is also available: Restore system-net-http.saz
The text was updated successfully, but these errors were encountered: