Skip to content
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

Debug startup performance (F5) #1691

Closed
VictorZakharov opened this issue Jun 4, 2021 · 5 comments
Closed

Debug startup performance (F5) #1691

VictorZakharov opened this issue Jun 4, 2021 · 5 comments

Comments

@VictorZakharov
Copy link

VictorZakharov commented Jun 4, 2021

Second round of debugging, without VS restart, it takes 35-40 seconds before web app is accessible (stops giving 503).
No changes were made to the project, without stopping containers (VS settings, per FAQ).
Should the debug startup time be in seconds?

My reference: I remember working on a solution with 170 projects, 1M LOC, where an incremental build was under 10sec.
It was an older version of VS (2017 I think). This solution is roughly 10K LOC, per code metrics report.

IDE: VS 2019 Enterprise version 16.10.0 (includes latest .NET SDK 5.0)
Hardware/Laptop: I can install SQL Server Standard in under 4min.
OS: Windows 10 Pro with latest updates.

@sughosneo
Copy link
Contributor

Hi @VictorZakharov, thank you for reaching out.

All the projects in the eShopOnContainer reference application have their respective docker file that starts building when you run the solution using Visual Studio. Because by default Docker-Compose project is the startup project. Now, when you run the solution, it takes some time for each instance of services to be up and running as containers and be ready to accept requests. That's when you see that 503 Service Unavailable Error. After running the solution, you can monitor the health of any service using check UI http://host.docker.internal:5107/ to see if all the services are up and running. When everything is green, then you can start exploring the specific app of your choice.

Also, please note to run the WebSPA using Visual Studio environment, you need to follow some extra step which has been captured in Setting the Web SPA application up

You may want to check out this extra configuration step to Stop Docker background tasks on project open

Hope this helps !

@VictorZakharov
Copy link
Author

VictorZakharov commented Jun 13, 2021

@sughosneo My concern was startup performance. Everything works, just slow. 35-40 seconds to start is when all containers were already built and running. At 10K LOC in the project, it's not scalable for production load. What if there were 500 projects with 5M LOC, will it take 5.5 hours to start debugging?

Math: 40 seconds for 10K, 5M is 500 times that, 20000 seconds, or roughly 5.5 hours.

Check this out: https://visualstudiomagazine.com/articles/2021/04/19/vs-2022.aspx

@maucaro
Copy link

maucaro commented Jun 21, 2021

@VictorZakharov , I agree with you. I opened a similar issue a little while ago ( #1673). In a separate one (#1511) I suggested Bridge to Kubernetes could be an option (unfortunately it is not yet). Until the inner development loop is efficient, I can't see how this approach can work in a real situation.

That said, I did find somewhat of a workaround: use VS Code instead. You can bring up the whole solution with "docker-compose up" and then attach to whichever container(s) you want to debug. If you make a change, only that container needs to be rebuilt. Not great, but better than what you are experiencing now.

HTH

@VictorZakharov
Copy link
Author

VictorZakharov commented Jun 21, 2021

Thanks @maucaro, I'll keep your alternative in mind.
VS Pro is a paid tool that usually provides a much smoother experience.
Having to find a container in order to attach to it is somewhat counter productive, vs clicking the "play" button.
Also VS Code doesn't support old .NET code (Winforms, WPF).

@erjain
Copy link
Contributor

erjain commented Feb 16, 2022

Considering the original question has been answered, I am closing this issue as of now. Please feel free to reopen if needed. Thank you.

@erjain erjain closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants