You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
extremely slow Network/Disk IO on Windows agent compared to Ubuntu/Mac #260
Ubuntu agents have slightly higher IOPS disk performance configuration. We use install-dotnet.ps1 script for installation provided by DotNet team . The DownloadFile and Extract-Dotnet-Package functions are being slow. We will investigate how to improve performance those functions if we replace DownloadFile -> WebClient and Extract-Dotnet-Package -> 7zip
DownloadFile and Extract-Dotnet-Package are awfully slow. Like 3x slower!
Most probably, the root cause of the problem was an infrastructure issue that has currently been resolved.
In case the problem reoccurs, the solution is to avoid bulk copying to the OS drive, similar to the workaround applied for the same problem in the actions/setup-go: actions/setup-go#393
@dsame I do not agree with the assessment that it is not reproducible 😓
Even with cache available Windows Server 2022 is still 20 seconds slower.
Creating the cache is still 1 minute longer than time of Ubuntu when running Windows Server 2022.
So definitely an improvement but I feel like windows can perform better.
I don't think it is fair to say look it is fixed for the actions/setup-dotnet when we are talking about a simple if check to see if .NET 6 is already available on the actions runner image 😓
Testing with .NET 8 preview shows ubuntu with 7 seconds vs +30 seconds sometime a little less. For actions/setup-dotnet.
Hi @jetersen 👋,
As mentioned by the runner-images team in this issue comment, unfortunately, there is no simple fix to align the C: drive's performance with the D: drive due to inherent limitations, and these are not expected to be resolved in the near future.
However, a feasible workaround is to set the DOTNET_INSTALL_DIR environment variable to a path on the D: drive to enhance build performance. You can configure it like this:
env:
DOTNET_INSTALL_DIR: D:\dotnet
Please feel free to reach out if you have any concerns or need additional assistance.
Thanks!
Thank you! I tested this. Note that this is only applicable to standard (4-core for public, 2-core for private repos) runners, not to larger ones, as those don't have a D drive.
Hi @Piedone,
Thank you for sharing your observations. Could you share the reproduction link or the specific runs used for the performance comparison of the NuGetTest and root workflows? This information would help us better understand the performance results.
There is a definite improvement. But still setup/dotnet install is still incredibly slow when comparing it to Linux or Mac.
So I still think there are improvements to be had in the usage of dotnet-install script.
The difference is Ubuntu 6 seconds vs Windows 16 seconds for the actions/setup-dotnet@v4 run step.
Which shows that install script is doing something it shouldn't.
The .sh relies on curl or wget. Why couldn't Windows rely on curl? GitHub actions runner have curl installed and in my experience avoids any overheads that Powershell or Invoke-WebRequest has when it comes to downloading files.
Hi @Piedone,
Thank you for sharing the information. Changing the DOTNET_INSTALL_DIR to the D drive has indeed improved the performance for the setup-dotnet step. However, the performance of dotnet build and dotnet test commands may not be significantly impacted by the installation directory of the .NET SDK alone.
To potentially enhance performance further, consider setting the NUGET_PACKAGES environment variable to a directory on the D drive, which may allow faster access to cached packages.
Hi @jetersen,
Thank you for your insights! We will investigate this further and see if we can implement these changes to enhance performance. We will consider this as a potential feature request for future improvements. In the meantime, please feel free to provide any additional details or suggestions you may have.
Thanks for the tip! This was very useful, since setting NUGET_PACKAGES reduced the workflow runtimes by 14-25%, see Lombiq/GitHub-Actions#402 (comment). I also did a test in a private repo with a .NET Framework build, and got a ~6% reduction there.
Activity
jetersen commentedon Jan 17, 2022
It can be fast:
jetersen commentedon Jan 17, 2022
Perhaps consider not using dotnet install script or is the option to contribute a fix to dotnet install script?
vsafonkin commentedon Jan 26, 2022
Hi @jetersen, we will try to resolve this problem.
PureKrome commentedon Aug 3, 2022
Hi Team - any news on this?
e-korolevskii commentedon Aug 3, 2022
Hello @PureKrome,
So far no updates
dsame commentedon Nov 2, 2023
The problem is not reproduced anymore.
Based on multiple runs, the action does not take more than 15 seconds.
https://github.com/akv-demo/dotnet.restore.slow.github.action/actions/runs/6729109167
Most probably, the root cause of the problem was an infrastructure issue that has currently been resolved.
In case the problem reoccurs, the solution is to avoid bulk copying to the OS drive, similar to the workaround applied for the same problem in the actions/setup-go: actions/setup-go#393
@jetersen did it help?
jetersen commentedon Nov 2, 2023
@dsame I do not agree with the assessment that it is not reproducible 😓
Even with cache available Windows Server 2022 is still 20 seconds slower.
Creating the cache is still 1 minute longer than time of Ubuntu when running Windows Server 2022.
So definitely an improvement but I feel like windows can perform better.
https://github.com/jetersen/dotnet.restore.slow.github.action/actions/runs/6736238225
https://github.com/jetersen/dotnet.restore.slow.github.action/actions/runs/6736262624
jetersen commentedon Nov 2, 2023
I don't think it is fair to say look it is fixed for the actions/setup-dotnet when we are talking about a simple if check to see if .NET 6 is already available on the actions runner image 😓
Testing with .NET 8 preview shows ubuntu with 7 seconds vs +30 seconds sometime a little less. For actions/setup-dotnet.
https://github.com/jetersen/dotnet.restore.slow.github.action/actions/runs/6736383956/job/18311632176
While this issue remains open: #141 this will definitely not improve 😢
dsame commentedon Nov 3, 2023
Thank you @jetersen for pointing out .NET 8 issue, it's confirmed
https://github.com/akv-demo/dotnet.restore.slow.github.action/actions/runs/6742358650/job/18328332807
Cache GitHub Actions (#565)
jetersen commentedon Nov 3, 2023
@dalyIsaac interesting approach, does that really save that much 🤔
7 remaining items
blackstars701 commentedon Dec 12, 2023
hi
v-priyagupta108 commentedon Dec 4, 2024
Hi @jetersen 👋,
As mentioned by the runner-images team in this issue comment, unfortunately, there is no simple fix to align the C: drive's performance with the D: drive due to inherent limitations, and these are not expected to be resolved in the near future.
However, a feasible workaround is to set the
DOTNET_INSTALL_DIRenvironment variable to a path on the D: drive to enhance build performance. You can configure it like this:Please feel free to reach out if you have any concerns or need additional assistance.
Thanks!
Piedone commentedon Dec 4, 2024
Thank you! I tested this. Note that this is only applicable to standard (4-core for public, 2-core for private repos) runners, not to larger ones, as those don't have a D drive.
Results are here: It seems to make things slower. What do you think?
v-priyagupta108 commentedon Dec 9, 2024
Hi @Piedone,
Thank you for sharing your observations. Could you share the reproduction link or the specific runs used for the performance comparison of the NuGetTest and root workflows? This information would help us better understand the performance results.
Piedone commentedon Dec 9, 2024
Sure, thank you! In my test, we're building the solution file in the root of our OSOCE project, as well as the solution in the NuGetTest folder. Runs:
You can disregard the failing builds; some parts of the workflow are flaky.
The following steps of the executed jobs are directly using the .NET SDK:
setup-dotnetplus some configuration.dotnet buildand related things.dotnet testfor unit and UI tests.jetersen commentedon Dec 9, 2024
@priyagupta108 I tested with my repro:

There is a definite improvement. But still setup/dotnet install is still incredibly slow when comparing it to Linux or Mac.
So I still think there are improvements to be had in the usage of dotnet-install script.
The difference is Ubuntu 6 seconds vs Windows 16 seconds for the
actions/setup-dotnet@v4run step.Which shows that install script is doing something it shouldn't.
The .sh relies on curl or wget. Why couldn't Windows rely on curl? GitHub actions runner have curl installed and in my experience avoids any overheads that Powershell or Invoke-WebRequest has when it comes to downloading files.
v-priyagupta108 commentedon Dec 11, 2024
Hi @Piedone,
Thank you for sharing the information. Changing the
DOTNET_INSTALL_DIRto the D drive has indeed improved the performance for thesetup-dotnetstep. However, the performance ofdotnet buildanddotnet testcommands may not be significantly impacted by the installation directory of the .NET SDK alone.To potentially enhance performance further, consider setting the
NUGET_PACKAGESenvironment variable to a directory on the D drive, which may allow faster access to cached packages.Hi @jetersen,
Thank you for your insights! We will investigate this further and see if we can implement these changes to enhance performance. We will consider this as a potential feature request for future improvements. In the meantime, please feel free to provide any additional details or suggestions you may have.
Piedone commentedon Dec 11, 2024
Thanks for the tip! This was very useful, since setting
NUGET_PACKAGESreduced the workflow runtimes by 14-25%, see Lombiq/GitHub-Actions#402 (comment). I also did a test in a private repo with a .NET Framework build, and got a ~6% reduction there.Optimize the GitHub actions Windows runner
Optimize the GitHub actions Windows runner