asp.net MVC website "waiting (TTFB)" from 10 to 20s

Julius 6 Reputation points
2021-03-19T07:58:45.443+00:00

Hello,

I have small MVC razor website on Windows Server 2016, not sure what happened but ~2 years was everything fine until now. Me and my clients noticed that website "went" slow by loading time from ~1s to ~10-30s. Adding screenshot below. Website has ~10-40 daily visits, mainly it's only information to read and contact. There is section to Login(via SQL), but problem is everywhere without using SQL, even page with 1 image and text is getting TTFB ~11s.. Windows Server 2016 hosted only this 1 website. Can anyone give a tip how to find and solve this "glitch" ?

79573-ttfb.png

Developer technologies | ASP.NET | Other
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Yihui Sun-MSFT 806 Reputation points
    2021-03-22T02:43:41.967+00:00

    Hi @Julius ,

    There are many factors that affect the time to the first byte (TTFB), most of which are beyond your control.

    But you can still use some feasible methods to reduce TTFB.

    1. Switch to a faster web host
    2. Keep your server as close to your users as possible
    3. Install a caching plugin
    4. Switch to a faster DNS provider
    5. Use a content delivery network (CDN)
    6. Try Cloudflare’s Argo
    7. The nuclear option: Cache everything on a CDN

    You can click this link to see a more detailed explanation.


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Best Regards,
    YihuiSun

    0 comments No comments

  2. astera123 6 Reputation points
    2021-03-22T14:29:49.623+00:00

    Updating my issue:

    My website is stored on windows server 2016 which is 2 meters from me, and it has 2 IP's 1 for the world 1 for localLAN. So I just put simple xml file into folder of website in my hosted location "D:\myWebsite", and if I'm manually writing address for e.g. "www.MyWebSiteURL.eu/SimpleXML.xml" that xml is loading fast and TTFB is ~6ms, yes ms!

    So connection is good, respond is fast. Even tried from mobile 4G. Next I tried to cut my code to find place "where it hangs", so I ended for deleting everything in "_Layout.cshtml" only this line left <!DOCTYPE html> </html>, and this line loads in 15-30seconds... I mean I just simple write "www.MyWebSiteURL.eu" and I have to wait ~15-30 seconds to load empty page, if I add in URL "/SimpleXML.xml" it loads in few ms.

    I'm using Visual Studio 2019 -> Build -> Publish -> Publish to folder.

    0 comments No comments

  3. astera123 6 Reputation points
    2021-03-24T09:55:56.947+00:00

    Problem solved: Kaspersky Security Console for Windows Server was causing problems by module: Real-Time File Protection

    https://support.kaspersky.com/5927, added few folders to exclusions and everything working.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.