Skip to content

Commit 0b6e245

Browse files
committed
Updates
1 parent 3d84684 commit 0b6e245

File tree

9 files changed

+225
-190
lines changed

9 files changed

+225
-190
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.introduction
3-
title: Introduction
4-
metadata:
5-
title: Introduction
6-
description: "Introduction"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 1
14-
content: |
15-
[!include[](includes/1-introduction.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.introduction
3+
title: Introduction
4+
metadata:
5+
title: Introduction
6+
description: "Introduction"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 1
14+
content: |
15+
[!include[](includes/1-introduction.md)]
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.explain-how-to-optimize-azure-storage-for-virtual-machines
3-
title: Explain how to optimize Azure storage for SQL Server virtual machines
4-
metadata:
5-
title: Explain how to optimize Azure storage for SQL Server virtual machines
6-
description: "Explain how to optimize Azure storage for SQL Server virtual machines"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 12
14-
content: |
15-
[!include[](includes/2-explain-how-optimize-azure-storage-virtual-machines.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.explain-how-to-optimize-azure-storage-for-virtual-machines
3+
title: Explain how to optimize Azure storage for SQL Server virtual machines
4+
metadata:
5+
title: Explain how to optimize Azure storage for SQL Server virtual machines
6+
description: "Explain how to optimize Azure storage for SQL Server virtual machines"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 12
14+
content: |
15+
[!include[](includes/2-explain-how-optimize-azure-storage-virtual-machines.md)]
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.describe-virtual-machine-resizing
3-
title: Describe virtual machine resizing
4-
metadata:
5-
title: Describe virtual machine resizing
6-
description: "Describe virtual machine resizing"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 4
14-
content: |
15-
[!include[](includes/3-describe-virtual-machine-resizing.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.describe-virtual-machine-resizing
3+
title: Describe virtual machine resizing
4+
metadata:
5+
title: Describe virtual machine resizing
6+
description: "Describe virtual machine resizing"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 4
14+
content: |
15+
[!include[](includes/3-describe-virtual-machine-resizing.md)]
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.optimize-database-storage
3-
title: Optimize database storage
4-
metadata:
5-
title: Optimize database storage
6-
description: "Optimize database storage"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 5
14-
content: |
15-
[!include[](includes/4-optimize-database-storage.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.optimize-database-storage
3+
title: Optimize database storage
4+
metadata:
5+
title: Optimize database storage
6+
description: "Optimize database storage"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 5
14+
content: |
15+
[!include[](includes/4-optimize-database-storage.md)]
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.control
3-
title: Control SQL Server resources
4-
metadata:
5-
title: Control SQL Server resources
6-
description: "Control SQL Server resources"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 7
14-
content: |
15-
[!include[](includes/5-control.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.control
3+
title: Control SQL Server resources
4+
metadata:
5+
title: Control SQL Server resources
6+
description: "Control SQL Server resources"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 7
14+
content: |
15+
[!include[](includes/5-control.md)]
Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.knowledge-check
3-
title: Module assessment
4-
metadata:
5-
title: Module assessment
6-
description: "Knowledge check"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 5
14-
content: |
15-
[!include[](includes/6-knowledge-check.md)]
16-
quiz:
17-
title: "Check your knowledge"
18-
questions:
19-
- content: "Which type of storage should be used with Azure VMs for SQL Server data files?"
20-
choices:
21-
- content: "Table storage"
22-
isCorrect: false
23-
explanation: "Incorrect. Table storage is a key value store and doesn't support file storage."
24-
- content: "Blob storage"
25-
isCorrect: false
26-
explanation: "Incorrect. Blob storage is an option for storing data files but isn't as flexible or performant as disk storage."
27-
- content: "Disk storage"
28-
isCorrect: true
29-
explanation: "Correct. Disk storage is designed for VMs and is the best storage option."
30-
- content: "Which of the following options can be limited using Resource Governor?"
31-
choices:
32-
- content: "Buffer pool allocation"
33-
isCorrect: false
34-
explanation: "Incorrect. Query memory grants can be controlled but buffer pool allocation can't."
35-
- content: "Write IOPs"
36-
isCorrect: true
37-
explanation: "Correct. Resource governor doesn't control write IOPs."
38-
- content: "Recompilation"
39-
isCorrect: false
40-
explanation: "Incorrect. RG has no control over compilation."
41-
- content: "Which is an option from the SQL Server Resource Provider for Azure VMs?"
42-
choices:
43-
- content: "Storage configuration"
44-
isCorrect: true
45-
explanation: "Correct. The resource provider configures your storage pool."
46-
- content: "Availability Groups"
47-
isCorrect: false
48-
explanation: "Incorrect. The provider doesn't configure this option."
49-
- content: "Maintenance plan"
50-
isCorrect: false
51-
explanation: "Incorrect. While you can configure backups, you can't configure maintenance plans."
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.knowledge-check
3+
title: Module assessment
4+
metadata:
5+
title: Module assessment
6+
description: "Knowledge check"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 5
14+
content: |
15+
[!include[](includes/6-knowledge-check.md)]
16+
quiz:
17+
title: "Check your knowledge"
18+
questions:
19+
- content: "Which type of storage should be used with Azure VMs for SQL Server data files?"
20+
choices:
21+
- content: "Table storage"
22+
isCorrect: false
23+
explanation: "Incorrect. Table storage is a key value store and doesn't support file storage."
24+
- content: "Blob storage"
25+
isCorrect: false
26+
explanation: "Incorrect. Blob storage is an option for storing data files but isn't as flexible or performant as disk storage."
27+
- content: "Disk storage"
28+
isCorrect: true
29+
explanation: "Correct. Disk storage is designed for VMs and is the best storage option."
30+
- content: "Which of the following options can be limited using Resource Governor?"
31+
choices:
32+
- content: "Buffer pool allocation"
33+
isCorrect: false
34+
explanation: "Incorrect. Query memory grants can be controlled but buffer pool allocation can't."
35+
- content: "Write IOPs"
36+
isCorrect: true
37+
explanation: "Correct. Resource governor doesn't control write IOPs."
38+
- content: "Recompilation"
39+
isCorrect: false
40+
explanation: "Incorrect. RG has no control over compilation."
41+
- content: "Which is an option from the SQL Server Resource Provider for Azure VMs?"
42+
choices:
43+
- content: "Storage configuration"
44+
isCorrect: true
45+
explanation: "Correct. The resource provider configures your storage pool."
46+
- content: "Availability Groups"
47+
isCorrect: false
48+
explanation: "Incorrect. The provider doesn't configure this option."
49+
- content: "Maintenance plan"
50+
isCorrect: false
51+
explanation: "Incorrect. While you can configure backups, you can't configure maintenance plans."
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.summary
3-
title: Summary
4-
metadata:
5-
title: Summary
6-
description: "Summary"
7-
ms.date: 03/20/2025
8-
author: JulianePadrao
9-
ms.author: jupadrao
10-
ms.topic: unit
11-
azureSandbox: false
12-
labModal: false
13-
durationInMinutes: 1
14-
content: |
15-
[!include[](includes/7-summary.md)]
1+
### YamlMime:ModuleUnit
2+
uid: learn.wwl.configure-sql-server-resources-for-optimal-performance.summary
3+
title: Summary
4+
metadata:
5+
title: Summary
6+
description: "Summary"
7+
ms.date: 04/01/2025
8+
author: JulianePadrao
9+
ms.author: jupadrao
10+
ms.topic: unit
11+
azureSandbox: false
12+
labModal: false
13+
durationInMinutes: 1
14+
content: |
15+
[!include[](includes/7-summary.md)]

learn-pr/wwl-data-ai/configure-sql-server-resources-optimal-performance/includes/4-optimize-database-storage.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,43 @@ When inserting 1 gigabyte of data into a SQL Server database with two data files
66

77
## Tempdb configuration in SQL Server
88

9-
SQL Server detects the number of available CPUs during setup and configures the appropriate number of files, up to eight, with even sizing. Additionally, the behaviors of trace flags 1117 and 1118 are integrated into the database engine, but only for tempdb. For tempdb-heavy workloads, it may be beneficial to increase the number of tempdb files beyond eight, matching the number of CPUs on your machine.
9+
SQL Server detects the number of available CPUs during setup and configures the appropriate number of files, up to eight, with even sizing. Additionally, the behaviors of trace flags 1117 and 1118 are integrated into the database engine, but only for `tempdb`. For tempdb-heavy workloads, it may be beneficial to increase the number of tempdb files beyond eight, matching the number of CPUs on your machine.
10+
11+
You use `tempdb` in the same way for both SQL Server and Azure SQL. Note, however, that your ability to configure `tempdb` is different, including the placement of files, the number and size of files, and `tempdb` configuration options.
1012

1113
SQL Server uses tempdb for various tasks beyond just storing user-defined temporary tables. It's used for work tables that store intermediate query results, sorting operations, and the version store for row versioning, among other purposes. Due to this extensive utilization, it's crucial to place tempdb on the lowest latency storage available and to properly configure its data files.
1214

13-
Before SQL Server 2016, tempdb defaulted to a single data file, leading to contention when multiple processes tried to access system pages. To address this issue, enabling trace flag 1118 was a common solution, as it changed the way extents were allocated. Another best practice was to create multiple tempdb data files. Since SQL Server uses a proportional fill algorithm for databases with multiple data files, it was crucial to ensure these files were the same size and grew at the same rate. To support this, many database administrator used trace flags 1117, which forced all databases with multiple data files to grow at the same rate.
15+
The database files of `tempdb` are always automatically stored on local SSD drives, so I/O performance shouldn't be an issue.
16+
17+
SQL Server professionals often use more than one database file to partition allocations for `tempdb` tables. For Azure SQL Database, the number of files is scaled with the number of vCores (for example, two vCores equals four files) with a maximum of 16. The number of files isn't configurable through T-SQL against `tempdb`, but you can configure it by changing the deployment option. The maximum size of `tempdb` is scaled per number of vCores. You get 12 files with SQL Managed Instance, independent of vCores.
18+
19+
The database option `MIXED_PAGE_ALLOCATION` is set to *OFF*, and `AUTOGROW_ALL_FILES` is set to *ON*. You can't configure this, but, as with SQL Server, these are the recommended defaults.
20+
21+
The `tempdb` metadata optimization feature introduced in SQL Server 2019, which can alleviate heavy latch contention, isn't currently available in Azure SQL Database or Azure SQL Managed Instance.
22+
23+
## Files and filegroups
24+
25+
SQL Server professionals often use files and filegroups to improve I/O performance through physical file placement. Azure SQL doesn't allow users to place files on specific disk systems. However, Azure SQL has resource commitments for I/O performance regarding rates, IOPS, and latencies. In this way, abstracting the user from physical file placement can be a benefit.
26+
27+
Azure SQL Database only has one database file (Hyperscale typically has several), and the maximum size is configured through Azure interfaces. There's no functionality to create more files.
28+
29+
Azure SQL Managed Instance supports adding database files and configuring sizes, but not physical placement of files. You can use the number of files and file sizes for SQL Managed Instance to improve I/O performance. In addition, user-defined filegroups are supported for SQL Managed Instance for manageability purposes.
30+
31+
## Database configuration
32+
33+
Commonly, you configure a database with the T-SQL `ALTER DATABASE` and `ALTER DATABASE SCOPED CONFIGURATION` statements. Many of the configuration options for performance are available for Azure SQL. Consult the [ALTER DATABASE](/sql/t-sql/statements/alter-database-transact-sql) and [ALTER DATABASE SCOPED CONFIGURATION](/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql) T-SQL reference for the differences between SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
34+
35+
In Azure SQL Database, the default recovery model is full recovery, which ensures that your database can meet Azure service-level agreements (SLAs). This means that minimal logging for bulk operations isn't supported, except for `tempdb`, where minimal logging is allowed.
36+
37+
### MAXDOP configuration
38+
39+
Max degree of parallelism (MAXDOP) can affect the performance of individual queries. SQL Server and Azure SQL handle `MAXDOP` in the same way. When `MAXDOP` is set to a higher value, more parallel threads are used per query, potentially speeding up query execution. However, this increased parallelism requires extra memory resources, which can lead to memory pressure and affect storage performance. For example, when compressing rowgroups into a columnstore, parallelism requires more memory, which can result in memory pressure and rowgroup trimming.
40+
41+
Conversely, setting MAXDOP to a lower value can reduce memory pressure, allowing the storage system to perform more efficiently. This is important in environments with limited memory resources or high storage demands. By carefully configuring MAXDOP, you can balance query performance and storage efficiency, ensuring optimal use of both CPU and storage resources.
42+
43+
You can configure MAXDOP in Azure SQL, similar to SQL Server, by using the following techniques:
44+
45+
- `ALTER DATABASE SCOPED CONFIGURATION` to configure `MAXDOP` is supported for Azure SQL.
46+
- The stored procedure `sp_configure` for "max degree of parallelism" is supported for SQL Managed Instance.
47+
- `MAXDOP` query hints are fully supported.
48+
- Configuring `MAXDOP` with Resource Governor is supported for SQL Managed Instance.

0 commit comments

Comments
 (0)