Database falls asleep

Discussion in 'Databases' started by Alternatex, Mar 9, 2018.

  1. Let me preface this by saying that I know that the database server I'm using won't be the fastest one in the universe. I'm on the Max plan but I understand that I'm on a shared hosting and that I'm sharing the DB server with a ton of other people.

    With that said, my databases still seems extremely slow to respond when they're accessed initially. After that they work fine. If they're not accessed for about an hour they fall into some kind of hibernation where it takes them quite a while to return data on first access.

    Before someone says anything about my data - I'm speaking of extremely small (4 tables) MS SQL databases with very little data in them. And I'm using Dapper.NET - which as a DAL library allows for the fastest access to the database besides ADO.NET.

    I've been doing some tests these last few days and the first response time of one of my databases (once it goes into hibernation after an hour or so) is around 12 seconds on average. I don't know about other people's performance expectations but 12 seconds is immensely slow. It's just the first time they're accessed after a while but it looks extremely bad when you visit someone's website and wait for 12 seconds. A new visitor is not even gonna care that it only happens the first time, they'll think the site is terrible.

    Everything I'm doing to try and make my sites faster goes out the window when I know that if they haven't been visited in a while their first load will be extremely slow.

    Is there anything that can be done about this?
  2. Elshadriel

    Elshadriel Winhost Staff

    This doesn't sound like a database issue. It's sounds like your application pool is timing out (there is a 15 minute Idle Time limit). When this happens and your site loads up again, it has to recompile your code before spinning up the application pool. The solution to this is to use precompiled assemblies or upgrade to the Ultimate plan and used the Scheduled Task Manager to hit a web page to prevent the application pool from timing out.
    Last edited: Mar 21, 2018
  3. Understood. Thanks for the answer.

Share This Page