SOLVED

About Azure SQL Database

Copper Contributor
Hi, how are you?
 
I wonder if you can help me to understand something about Azure SQL Database in the Azure Calculator. This is:
 
SQL DB Calculator.PNG
 
I have read extensively here and here
I understand that Min and Max vCores is the range in wich the compute will be scaled and billed, but I can get:
 
  1. CPU Used
  2. Memory Used
  3. Duration. ¿Is this the auto pause delay (link)?
I hope you can help me to understand
 
Best regards
 
Jona
10 Replies

@Jonas 

 

The duration is a window of time in which the database will be auto-paused if the following two conditions are true for the full duration of that window:

 

  • Number of sessions = 0; and
  • CPU = 0 for user workloads.

 

So, if you had a really short duration value of 3,600 (one hour), then if the number of sessions remains at zero for an hour, and the user CPU utilisation also remains at 0 for that hour, the database will be auto-paused.

 

LainRobertson_0-1693380555255.png

 

Cheers,

Lain

Thanks @LainRobertson 

 

¿What about the other two options? That is CPU Used and Memory Used. I get confused with these two, because we are talking about a scaling serverless tier that in theory doesn't have provisioned a fixed CPU or Memory

 

Best regards

@Jonas 

 

Hey, Jonas.

 

"Serverless" isn't the best term as it can be a bit misleading. The servers are still there, of course, but the difference between the two relevant tiers - "serverless" and "provisioned" is how Microsoft bills you for them.

 

Starting with the "provisioned" tier - which is more familiar to most people since it's very much the same as a traditional server, you choose how much compute (notably, CPU and memory) and it's always there, and always "on", which in turn means you're always being charged - and at a fixed rate.

 

In contrast, the "serverless" tier requires that you specify minimum and maximum values for the compute, and additionally asks you for the "duration" it should wait before turning the service "off". This carries the following cost benefits:

 

  • The fewer resources being used, the less you're being charged;
  • When the service is "auto-paused" (or off, if you prefer), you're not being charged for the the compute elements (CPU and memory), meaning you're only paying for storage (since that's always in use.)

 

There's performance considerations as well when deciding between provisioned and serverless, but the relationship between CPU, memory and auto-pausing is a cost relationship.

 

Here's some succinct summaries:

 

 

Cheers,

Lain

Hi @LainRobertson 

 

I completely agree with you,  bou my question was around the other two items in the pricing calculator of the Azure SQL Database

 


¿What about the other two options? That is CPU Used and Memory Used. I get confused with these two, because we are talking about a scaling serverless tier that in theory doesn't have provisioned a fixed CPU or Memory


SQL DB Calculator - v2.PNG

 

I appreciate very much yout time and help

@Jonas 

 

I think you're getting too caught up on the term "serverless".

 

The CPU and memory settings shown in that screenshot are the same as those found in all decent hypervisors for over a decade now, meaning they're not anything new.

 

Essentially, these two settings (along with duration) relate to two concepts:

 

  1. Efficient use of limited resources;
  2. Financial budgeting.

 

Behind the scenes, the "serverless" option is still ultimately running on a server - there's nothing magic about it.

 

SQL Server has actually had these variable settings for even longer than hypervisors have. If you've ever set up SQL Server before, you should already be familiar with specifying lower and upper memory limits and CPU affinity (not really the same thing as vCore limits but close enough for this conversation.)

 

The only thing within your control is setting the limits, which is generally in accordance with service usage patterns and financial budget constraints.

 

Cheers,

Lain

Hi @LainRobertson 

 

You're right, the term "serverless" got confused me. However, based on your clarification I feel much more clear.

 

So, we could say that CPU Used and Memory Used would be the resources this instance would use at rest, and eventually scale in the range of vCores specified

 

Am I right?

 

Best regards

best response confirmed by Jonas (Copper Contributor)
Solution

@Jonas 

 

So, there's two states which mean different things for the compute resources (CPU and memory):

 

  1. The SQL "serverless" service is running;
  2. The SQL "serverless" service is stopped (which is called "auto-paused").

 

The SQL service is running

  • This is like when a computer is switched on, meaning you are paying for using CPU, memory and storage;
  • If the SQL workload is light, the amount of memory and CPU will likely be towards the lower value limits you entered on the configuration page, which translates into a lower bill when it comes time to pay (since you only pay based on utilisation);
  • If the workload is busy, the amount of memory and CPU will likely be towards the upper limits you entered on the configuration page;
  • If there's no SQL workload at all for the timeframe specified as the "duration" on the configuration page, then the SQL "serverless" service is stopped (called "auto-paused").

 

The SQL service is stopped (auto-paused)

  • This is like when you shut down a computer;
  • CPU and memory are no longer being used as the SQL instance is effectively "switched off";
  • This means you are saving money, as Microsoft isn't billing you for CPU or memory as the SQL instance is "switched off";
  • You are still charged for storage while the instance is switched off;
  • You don't have to "turn the SQL instance back on" again, as that will happen automatically once any kind of workload tries using the SQL instance again (although there will be a delay and things will run a bit slower for a short while after it starts itself back up again).

 

Cheers,

Lain

Hi @LainRobertson , sorry if I bother you too much.

 

Let me find out if I get it righ now, based on picture of the first post:

 

If the SQL workload is light, the amount of memory and CPU will likely be towards the lower value limits you entered on the configuration page, which translates into a lower bill when it comes time to pay (since you only pay based on utilisation);

So, in this case it will scale down and use 8 vCores (minimum) and 24 GB RAM, at minimum

 

If the workload is busy, the amount of memory and CPU will likely be towards the upper limits you entered on the configuration page;


In this case it will scale up and use up to 14 vCores (maximum) and 42 GB RAM, at maximum

is that right?

 

Best regards

Jona

@Jonas 

 

Hi, Jona.

 

Yes, that is correct.

 

Cheers,

Lain

Thanks very much for all your time and answers

Greeting from Chile
Jona
1 best response

Accepted Solutions
best response confirmed by Jonas (Copper Contributor)
Solution

@Jonas 

 

So, there's two states which mean different things for the compute resources (CPU and memory):

 

  1. The SQL "serverless" service is running;
  2. The SQL "serverless" service is stopped (which is called "auto-paused").

 

The SQL service is running

  • This is like when a computer is switched on, meaning you are paying for using CPU, memory and storage;
  • If the SQL workload is light, the amount of memory and CPU will likely be towards the lower value limits you entered on the configuration page, which translates into a lower bill when it comes time to pay (since you only pay based on utilisation);
  • If the workload is busy, the amount of memory and CPU will likely be towards the upper limits you entered on the configuration page;
  • If there's no SQL workload at all for the timeframe specified as the "duration" on the configuration page, then the SQL "serverless" service is stopped (called "auto-paused").

 

The SQL service is stopped (auto-paused)

  • This is like when you shut down a computer;
  • CPU and memory are no longer being used as the SQL instance is effectively "switched off";
  • This means you are saving money, as Microsoft isn't billing you for CPU or memory as the SQL instance is "switched off";
  • You are still charged for storage while the instance is switched off;
  • You don't have to "turn the SQL instance back on" again, as that will happen automatically once any kind of workload tries using the SQL instance again (although there will be a delay and things will run a bit slower for a short while after it starts itself back up again).

 

Cheers,

Lain

View solution in original post