2

I have .NET Core MVC project with Vue.js framework which I got to maintain.

I ran into an issue which is time to full load app when debugging locally in visual studio (via IIS Express). There is several request (to my API controller) for JSON data that takes about 30-40s TTFB which makes full load in about a 1 minute. But when I ran the single request alone, it takes only about 4s to return data. Even a small 7KB png logo take 17s TTFB, but with the same request alone it takes only 4.5s.

I tried all possible solutions I found on Google, MSDN and SO... Visual Studio options shenanigans, PerfView analysis, Excluding and even hiding "node_modules" file from VS, but nothing seems to improve it even a little.

I have also my own training/test Vue.js (little bit less complex) website on the same machine and there is no problem and TTFB is under 1s.

VS Request:

VS request

Request Alone:

Request alone

phepa
  • 71
  • 1
  • 3
  • 9
  • Are you running on a Mac? I remember having these kinds of problems back then. I think I went into the hosts file and changed something, as described here: https://stackoverflow.com/questions/2386299/running-sites-on-localhost-is-extremely-slow – Peheje Jan 28 '19 at 15:08
  • 1
    Nono, i am running it locally on my virtual W10 – phepa Jan 28 '19 at 15:11
  • Have you tried running the same solution in a non-virtualized environment? I remember I had some troubles if I remember correctly, but I had a setup where you could expose the IIS inside the VM to the host. – Peheje Jan 30 '19 at 11:17
  • Well, it has to be virtualized environment since there is some ip routing, custom DNS, firewalls to the WS Federation server and SQL. – phepa Jan 31 '19 at 08:13

1 Answers1

0

I ran into the same problem with uploading photos to the server and TTFB time was so high without any reason (at the time). After digging through similar issues and debugging many times, I have found out that IIS servers do not hold services in the app pool if there is no request lately. In my case it was the only first endpoint called from FE and they were hosted in different docker images. You can check out my questions to see my similar question.

To solve the issue I added health check endpoints to every single service instance just to keep them awake, to not dropped from application pool of IIS. To do that I implemented health check request with 5 min. interval in my .NET Core Gateway project and problems seem to resolved. If you’re running your projects on IIS, I would suggest you to do the same.

Hasan
  • 1,243
  • 12
  • 27
  • I am using IIS Express here – phepa Jan 28 '19 at 15:32
  • I make it to use standart IIS it makes little bit of an improve in order to load js and css files about `15-20s`, but the requests still takes long time. – phepa Jan 29 '19 at 13:59