Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Angular example template without any modification is so slow in production #1392

Closed
gyantal opened this issue Nov 21, 2017 · 2 comments
Closed

Comments

@gyantal
Copy link

gyantal commented Nov 21, 2017

Why is the Angular example template without any modification so slow in production?

It takes about 1.06 sec to refresh http://localhost:5000/home on local server.
How can this be a Production quality example?
1 second is too much. For most of the server admins this is not acceptable.
I am using DotNetCore version 2.0.3 on Windows x64.
To reproduce: (just the basic, without any modifications):

"dotnet new angular"
"npm install"
"dotnet restore"
"dotnet run", which says: "Hosting environment: Production"

In Chrome browser, press F12 and go to Network. And Paste http://localhost:5000/home to URL field.
Then hit Refresh sporadically. For getting the "home" or "localhost" document which is 6KB the query time is:

  • 1st Refresh: 2.5 seconds. // Fine. First time the preparations take some time.
  • Hit Refresh very quickly (in every 2-3 seconds): 45msec
  • Hit Refresh while waiting about 5 seconds between Refreshes: 1.06 sec

So, it is 1 second in general for a random user accessing the website with some infrequency. With local webserver! Is it the best we can do?
Could you enlighten me why it is that slow or fix it please?
Thanks.

@SteveSandersonMS
Copy link
Member

I wouldn't expect it to have a 1s delay when deployed fully, for example to Azure or to a full IIS instance. However if you need to track down the exact timings you would need to insert more logging or other instrumentation so you can get the timestamps relating to different parts of the request (e.g., when ASP.NET first starts receiving the request, when it starts making a call to Node for prerendering (if you have that enabled), when Node responds, when it starts serving the response HTML, and when it finishes serving the response HTML).

As it happens, the next version of the Angular template is structured very differently because it's based on Angular CLI. You might want to try out a preview of that version and see how it performs for you.

@aloker
Copy link

aloker commented Feb 18, 2018

Probably related to keepAliveTimeout: #1542

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants