0

I made an simple webapi that retreives some data from a azure sql server. But i noticed, every time when i make a request to get some data, it takes some time to load it (5+- seconds). The second time within a short period (for example 5 minutes) it will retreive it way faster.

Is there something like a machine spin up that creates this delay? And is there a way to get rid of this delay? Its very anoying...

Or might this be another problem? Or is there a way to confirm/debug this idea? I'm even not sure that this issue is caused by a spin up.

Joris Brauns
  • 263
  • 1
  • 3
  • 17
  • Are you talking about Sql Azure or Sql IaaS VMs? There shouldn't be a delay at all in Sql Azure since it's a true database as a service with HA. – Kakira Oct 06 '14 at 04:27

2 Answers2

1

IIS hosted websites/services time out by default after 20 minutes of inactivity - see this SO post for info & links.

Depending on how your WebAPI project is deployed in Azure, you have little to no control on this setting. Your best option is to use an application or service to ping your website/service every 5 minutes or so to keep it alive (i.e. no idle timeout). Azure does offer endpoint monitoring (depending on your deployment/subscription status) that will satisfy the ping.

Community
  • 1
  • 1
viperguynaz
  • 12,044
  • 4
  • 30
  • 41
0

Thanks @viperguynaz, 'iddle timeout' did me find this topic: Will "Always On" setting prevent BOTH idleTimeout and periodicRestart?

Apparently Azure does support a feature to turn off iddle timeout on web projects. This options is only available when your scale is configured for:

- basic
- standard

This option is however not for free if you want to keep the price low, but hey its an option! ;-)

Community
  • 1
  • 1
Joris Brauns
  • 263
  • 1
  • 3
  • 17