Score:0

Azure Serverless SQL will not pause due to Azure service queries keeping it online

cn flag

There is a database we use for archiving old data which I want to be 'serverless' so that it only fires up when we make a query.

I changed the size from standard to serverless without issues. I have not connected to this DB since making the change.

However it doesn't pause despite setting the auto-pause to 1 hour.

Looking in Query Performance Insight, I can see there is a query which regularly polls the DB for size information... every hour at least.

(@type int)SELECT file_id, name, size AS size_8KB, max_size AS max_size_8KB, ISNULL(FILEPROPERTY(name, 'SpaceUsed'), size) AS space_used_8KB FROM sys.database_files WHERE type = u/type ORDER BY size DESC

If Azure SQL Serverless thinks the DB is in use because Azure services are polling the DB several times an hour to get information, it'll never auto pause?

Am I doing something wrong?

DaveF avatar
bv flag
Did you work out the source of this query in the end? I'm having a very similar problem, with a query that appears to be checking database size and the database not auto-pausing.
Damo avatar
cn flag
yes. stupidly, when you navigate to the database in the Azure web portal, it sends a query to the database, keeping it alive each time. The trick (for us at least) is leave it alone and don't keep checking on it.
DaveF avatar
bv flag
Thank you. That's very helpful. Now to track down whoever is leaving the portal open 24/7
Score:0
cn flag

Azure SQL Serverless "thinks" the DB is in use because the DB is in use!

You did a good investigation and you even found the query that is using it. Good!

Azure SQL Database Serverless will not pause if it keeps receiving requests.

So the solutions are:

  • Find who is making that request and stop it
  • Maybe serverless is not the right option for you and you can move to some S* plan
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.