-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add gzip support for v3 feeds to improve registration json file download performance #1909
Comments
@OliverRC what version of NuGet are you using? The latest is 3.3.0. |
It is really slow for me too. I have NuGet 3.3.0. And I am using different package sources:
Is there a way do debug/trace what's happening? |
I am using NuGet 3.3.0. We've always had 2 sources and prior to VS2015 and NuGet 3 it has been quick. |
There are two changes in NuGet 3.X compared to 2.X (for various scenarios, not just updates)
Things you can look into:
|
CC @johnataylor who is going to work on improving this in 3.4 |
I understood why it was slow for me. My "internal company's NuGet source" is available only in the company's network (or when using VPN). But I was updating packages from home and was not connected through VPN. The only question is why NuGet is so slow in this case. Failure response is sent within 10-15 seconds, but NuGet is gathering dependency information for 15-20 minutes. |
Because it is making multiple request, and doesn’t recognize this feed is down. We plan to add a feature for detecting this and warning you in one of the future releases. |
Does it enumerate all sources for each dependency? I have read this, it doesn't however explain the level of "slowness".
For WebAPI (MV6) I think these are all still in Preview.
What does this mean? Do you get ALL the versions of ALL dependencies from ALL sources? Ultimately having to wait 5 minutes to update a package with 1 dependency indicates some issue, |
|
I admit I probably don't 100% grasp the full complexity of the problem but from the outside this seems like an odd way of doing things. In a package I clearly state which version my dependencies should be, why then would you need to enumerate ALL versions? Sure, semantic versioning can be tricky with ranges at all that but at a minimum we hint at the version required that still means only a subset needs to be enumerated. I feel my particular problem comes from the fact that we have continuous integration which builds our internal packages on every check-in, meaning that we have lots of version... which (need to double check this) is causing the enumeration to be slow. That said I don't think this is an uncommon scenario. We |
We completely agree and plan to improve on this on the next release. In the meantime I have a few suggestions
Regardless we are on the same page and plan to improve this. Work on this improvement has started already |
@OliverRC we have made a few strides in this area, but I'm not sure if we covered your scenario enough. Would you mind trying to use NuGet 3.4RC and tell us what you see so far? https://dist.nuget.org/index.html I'm keeping this open in 3.5 because we plan to keep investing in this area after the 3.4 release, but we would really like to know how much this impacted your scenario so far. |
Couple of additional comments on this. With regards to doing a more intelligent range based request for the package version. We looked into this in some detail, and we actually have protocol that allows us to arrange package metadata for multiple versions more effectively (we effectively split the metadata into a tree and walk that if there is a very large number of versions.) However, we have found it difficult to optimize this in the light of multiple sources. In fact difficult to fully leverage our own protocol. Consider fetching the metadata for a package X that depends on package Y from two sources A and B. When we look at source A we see versions of X and we see their dependencies on Y. Because we see those dependencies we know what not to get from A in terms of Y's metadata. However when we look at B we see more versions of X some of which imply that we should have technically gathered more metadata about Y from A. So given the assumption that we want to be able to resolve if we possible can we have a choice of either getting everything from everywhere or iterating and possibly going back to sources we've already been to to get more metadata. So far the implementation choice has been to gather everything from everywhere but do so in a concurrent way. One immediate thing that would be done is divide the metadata between release and pre-release. Currently we mix these together. Separating these, with an assumption that for packages that have many, many versions many of those versions are pre-release, this would help. In 3.4 we at least fixed the problem that the metadata wasn't gzipped. That was an unfortunate oversight in the initial releases of 3.x. gzipping the JSON can reduce it by as much as 80%. |
3.4 RC1 improved this issue considerably in comparison with 3.3, specially to find updates and consolidation but it's still slow, when it's "Attempting to gather dependency information". I normally have to go back to Visual Studio 2013 to update the nugets instantly. |
Thanks for the work on this! I will try out the RC version and feedback |
It's not fully integrated. PackageRefernece breaks many nugent packages.
"""Some examples of scenarios that will not be supported include content
folders (we have introduced ContentFiles), XDT transforms, PowerShell
scripts i.e. install.ps1 and uninstall.ps1 (only init.ps1 is supported)"""
It's not ready for production.
And nuget is doing NOTHING. It has already downloaded the assemblies. All
it has to do is patch some project files and package.config files. In a
solution of 60 projects it is exactly the same patch done to every single
project. I am pretty sure it's making network requests for information that
it all ready has thousands of times over or doing weird things with the
visual studio DTE.
…On Wed, 17 May 2017, 18:37 Justin Emgarten ***@***.***> wrote:
@bradphelan <https://github.com/bradphelan> executing nuget actions
includes the time it takes to add and remove assembly references and
content files through Visual Studio. Network traffic is done at that point
and there is relatively little happening in NuGet. The time here can be
impacted by the size of the project and the number of assemblies being
added.
I suggest switching to *PackageReference* which is now supported for
non-NETCore projects in Visual Studio 15.2. It works by writing out all
references to a file on disk instead of using Visual Studio to add/remove
each references, which is the bottle neck in packages.config.
http://blog.nuget.org/20170316/NuGet-now-fully-integrated-into-MSBuild.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1909 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABE8uPco2CHNj9TOH_FiAzeb3Fu4krYks5r6yJcgaJpZM4HCI7w>
.
|
If you find this to be the case please open a new issue for it with details as to exactly where this is happening. I would be happy to fix this and improve the performance here for packages.config projects. |
How to find "exactly where it is happening" All I see in the log is stuff like I just can't imagine what an 8 core multi gigaherz processor is doing for 30 seconds as it attempts to update a 30 line config file. The CPU is pegged at 25% usage How to get nuget to spit out more info that could help you find the source of the problem. I would gladly assist if you can provide any suggestions. |
I have JetBrains profiler as well. If you can suggest exactly what I should be trying to profile I can have a go at that. |
This issue might be related. Others have reported that allowing Nuget to add binding redirects is terribly slow. #1147 |
Turning off nuget generated binding redirects seems to speed the install. We are now at an average of 8 to 12 seconds per projects rather than 30 to 40 seconds. Something must be wrong with the binding redirect generation. |
Hi, I've been experiencing the same problem for about a couple of weeks.
It often takes around 30-40seconds. It does sometimes (rarely) take less than a couple of seconds. I'm using VS2015 and NuGet 3.5.0 I have unchecked and then removed all of my custom config sources. I have even tried to install packages from the local disk instead of NuGet. My custom NuGet package sources are:
My Machine-wide package sources: I recently installed the Service Fabric SDK to Visual Studio which added a machine-wide local Service Fabric package source. I've tried to remove the file from "C:\ProgramData\NuGet\Config\ServiceFabricSDK.config" but it keeps coming back when I launch VS, though it now points at nuget.org: Is there any easy way to see what NuGet is doing in 3.5.0? |
I've just realized I could use the Verbose option of Install-Package:
Where Home is the name of my local repository. See the attached log file for the output of the Verbose command. Install-Package is performing many calls toward nuget.org and I'm wondering if this is what is supposed to happen. |
Increasing connections limit in ...
<system.net>
<!-- these 3 lines were already there -->
<settings>
<ipv6 enabled="true"/>
</settings>
<!-- I've added only these 3 lines -->
<connectionManagement>
<add address="*" maxconnection="256" />
</connectionManagement>
</system.net>
... Update: after the latest update 15.2 (26430.14), it's necessary to edit |
This is golden. |
I tried that. It still took 17 minutes to update around 60 projects from one version of a nuget package to another |
Why is this closed? This is absolutely an issue. Today I was upgrading one of our dependencies. Nuget made about 1000 requests before it completed. This is getting worse with .Net Core as everything is split into millions of small packages. |
Yeah, even though the increased connection limit speeds things up, it is anything but blazingly fast. |
I think one thing that makes this very slow is the response time from the Nuget.org feed. This is just a snippet from a
It makes 1000's of requests to |
This is NOT closed! |
Agreed. Same issue here - custom package source (MyGet) and a super slow update time in VS2015. 1 package, updated in 11 projects, took 4 minutes 24 seconds. Notes:
Nuget version VS Version Output window log (TL;DR version - Only times)
|
I just recently updated from VS2015 to VS2017. Out Build server, Is using the version nuget 3.3.0.212. This is the first time updating a package with vs2017, and it took around 59 seconds with a warning about lowest dependency. I removed the package and reinstalled the package.
I restarted Visual Studio to check the reinstall behavior,
Well that's my state. I think my dependency tree should be rather simple. So I guess there is an error, actually, the first time it took so long I closed Visual Studio. :) Update: I was talking with an colleague about it. He commented it, that he got on the same day also problems but did go in the direction of our IT/Network. So tried the same case again. This time 5 seconds. It's like blaming the service people that the producer does not deliver one day before and I feel sorry for it. If a verbosity option or a measure option will help. The content and amount of such arising issues might drop. |
This takes at least 5-6 minutes per package on any aspnet project I have, even reinstalling existing packages takes minutes upon minutes. No network activity and no cpu activity, just sits there doing nothing. I spent almost an hour fixing a package issue the other day as I had to re-install them a few times due to a path issue I had. Drove me bonkers! |
Yep, it's really frustrating. Dependency hell in it's own way.
Related? #4534 |
@patroza can you provide a repro solution where it takes 15 mins to gather dependencies? we can then further analyze it. @rolandh As you mentioned no network activity or cpu activity, so it means it's not related to "attempt to gather dependency information....." step so would you mind opening another issue with detailed steps and repro solution? |
@jainaashish I'd re-open this. It is not solved. |
@jainaashish it happens a lot on WPF projects using packages.config targeting '.NETFramework,Version=v4.6.1', often the first one takes 1.5mins+, and the next one 3.5mins+. Also once it goes into Uninstalling/Removing/Installing packages within an upgrade cycle, things are painfully slow and cpu+mem usage quite high, and VS not being responsive. Initial issues were noted on 15.3, now i'm on 15.3.1 with similar experience. |
Everyone who is still hitting issues with slow updates, please open a new issue and provide detailed repro steps. There are many different reasons why this could occur, the original problem this issue covered has been fixed. Trying to track all possible scenarios, including those unrelated to NuGet in a single generic issue makes it difficult to plan and prioritize this work. |
Unfortunately I cannot easily reproduce it. All I can say is it occurs on WPF projects with 15+ nuget packages targeting 4.6.1 |
@emgarten I have a perfectly legitimate example of the potential issue. Nuget.org is flippen slow:
6.5s to query 1 package! Now multiply that by the total number of packages and you can see why many of us are experiencing terrible performance. |
Since moving to VS2015 and Nuget 3 the Update-Package command takes an age to complete.
It just sits stuck on "Attempting to gather dependencies information"
Specifying an exact version or source makes not difference. Sits at this step for what seems like minutes.
The text was updated successfully, but these errors were encountered: