Since August 16th, and especially since August 21st, the NuGet Gallery has been exhbiting intermittent performance issues. Some users are reporting errors when attempting to browse or search for NuGet packages from Visual Studio or other clients. Many users are reporting that browsing and searching are slow. There have also been timeout errors when browsing the gallery’s packages page.
We have been working to address these performance issues over the last several days, and we hope to have a deployment in place this evening (August 22nd, Pacific Time). It looks like the deployment will cause a short outage though–we will post more information about that when the details are available.
The root cause of the performance issues boils down to some sub-optimal queries that are used when searching the gallery–especially when searching from Visual Studio. There are a couple reasons these queries are slow:
- Some missing indexes that could significantly aide the search queries.
- Table columns that have nvarchar(max) as their data type when a size constraint can be applied. We are seeing that when these nvarchar(max) columns are used in ORDER BY clauses, it becomes a bottleneck.
The deployment we’re preparing will address both of these issues by adding size constraints to many fields and then creating several new indexes. Unfortunately, the process of altering the Packages and PackageRegistrations tables and then creating these new indexes is going to take some time to apply – during that time, the database will be rather unresponsive. Again, when we know more about the timing of the outage, we’ll share the details.