Azure SQL 托管实例资源限制概述Overview of Azure SQL Managed Instance resource limits

适用于:是Azure SQL 托管实例 APPLIES TO: yesAzure SQL Managed Instance

本文概述了 Azure SQL 托管实例的技术特征和资源限制,并提供了有关如何请求提高这些限制的信息。This article provides an overview of the technical characteristics and resource limits for Azure SQL Managed Instance, and provides information about how to request an increase to these limits.


有关支持的功能和 T-SQL 语句的差异,请参阅功能差异T-SQL 语句支持For differences in supported features and T-SQL statements see Feature differences and T-SQL statement support. 有关 Azure SQL 数据库和 SQL 托管实例中服务层级之间的一般差异,请参阅服务层级比较For general differences between service tiers for Azure SQL Database and SQL Managed Instance see Service tier comparison.

硬件代次特征Hardware generation characteristics

SQL 托管实例的某些特征和资源限制取决于底层基础结构和体系结构。SQL Managed Instance has characteristics and resource limits that depend on the underlying infrastructure and architecture. SQL 托管实例可部署在两个硬件代系上:Gen4 和 Gen5。SQL Managed Instance can be deployed on two hardware generations: Gen4 and Gen5. 硬件代次具有不同的特征,如下表所述:Hardware generations have different characteristics, as described in the following table:

Gen4Gen4 Gen5Gen5
硬件Hardware Intel® E5-2673 v3 (Haswell) 2.4-GHz 处理器、附加的 SSD vCore = 1 PP(物理核心)Intel® E5-2673 v3 (Haswell) 2.4 GHz processors, attached SSD vCore = 1 PP (physical core) Intel® E5-2673 v4 (Broadwell) 2.3 GHz、Intel® SP-8160 (Skylake) 和 Intel® 8272CL (Cascade Lake) 2.5 GHz 处理器、快速 NVMe SSD、vCore = 1 LP(超线程)Intel® E5-2673 v4 (Broadwell) 2.3 GHz, Intel® SP-8160 (Skylake), and Intel® 8272CL (Cascade Lake) 2.5 GHz processors, fast NVMe SSD, vCore=1 LP (hyper-thread)
vCore 数目Number of vCores 8、16、24 个 vCore8, 16, 24 vCores 4、8、16、24、32、40、64、80 个 vCore4, 8, 16, 24, 32, 40, 64, 80 vCores
最大内存(内存/核心比)Max memory (memory/core ratio) 每个 vCore 7 GB7 GB per vCore
添加更多 vCore 以获得更多内存。Add more vCores to get more memory.
每个 vCore 5.1 GB5.1 GB per vCore
添加更多 vCore 以获得更多内存。Add more vCores to get more memory.
最大内存中 OLTP 存储Max In-Memory OLTP memory 实例限制:每个 vCore 1 - 1.5 GBInstance limit: 1-1.5 GB per vCore 实例限制:每个 vCore 0.8 - 1.65 GBInstance limit: 0.8 - 1.65 GB per vCore
最大实例保留存储Max instance reserved storage 常规用途:8 TBGeneral Purpose: 8 TB
业务关键:1 TBBusiness Critical: 1 TB
常规用途:8 TBGeneral Purpose: 8 TB
业务关键型 1 TB 或 2 TB,具体取决于核心数Business Critical 1 TB, or 2 TB depending on the number of cores


  • Gen4 硬件正在逐步淘汰,不能再用于新部署。Gen4 hardware is being phased out and is not available anymore for new deployments. SQL 托管实例的所有新实例都必须部署在 Gen5 硬件上。All new instances of SQL Managed Instance must be deployed on Gen5 hardware.
  • 请考虑将 SQL 托管实例的实例迁移到 Gen 5 硬件,体验范围更广泛的 vCore 和存储可伸缩性、加速网络、最佳 IO 性能和最小延迟。Consider moving your instance of SQL Managed Instance to Gen 5 hardware to experience a wider range of vCore and storage scalability, accelerated networking, best IO performance, and minimal latency.

内存中 OLTP 可用空间In-memory OLTP available space

业务关键服务层级中的内存中 OLTP 空间量取决于 vCore 数和硬件代次。The amount of In-memory OLTP space in Business Critical service tier depends on the number of vCores and hardware generation. 下表列出了可用于内存中 OLTP 对象的内存限制。The following table lists limits of memory that can be used for In-memory OLTP objects.

内存中 OLTP 空间In-memory OLTP space Gen5Gen5 Gen4Gen4
4 个 vCore4 vCores 3.14 GB3.14 GB
8 个 vCore8 vCores 6.28 GB6.28 GB 8 GB8 GB
16 个 vCore16 vCores 15.77 GB15.77 GB 20 GB20 GB
24 个 vCore24 vCores 25.25 GB25.25 GB 36 GB36 GB

服务层特征Service tier characteristics

SQL 托管实例有两个服务层级:常规用途业务关键SQL Managed Instance has two service tiers: General Purpose and Business Critical. 这些层级提供不同的功能,如下表中所述。These tiers provide different capabilities, as described in the table below.


业务关键服务层提供了 SQL 托管实例的附加内置副本(次要副本),可用于只读工作负载。Business Critical service-tier provides an additional built-in copy of the SQL Managed Instance (secondary replica) that can be used for read-only workload. 如果可以隔离读写查询和只读/分析/报告查询,则能够以相同的价格获得两倍的 vCore 和内存。If you can separate read-write queries and read-only/analytic/reporting queries, you are getting twice the vCores and memory for the same price. 次要副本可能滞后于主要实例几秒,因此它旨在卸载不需要确切的当前数据状态的报告/分析工作负荷。The secondary replica might lag a few seconds behind the primary instance, so it is designed to offload reporting/analytic workloads that don't need exact current state of data. 在下表中,只读查询是在次要副本上执行的查询。In the table below, read-only queries are the queries that are executed on secondary replica.

功能Feature 常规用途General Purpose 业务关键Business Critical
vCore 数目*Number of vCores* Gen4:8、16、24Gen4: 8, 16, 24
Gen5:4、8、16、24、32、40、64、80Gen5: 4, 8, 16, 24, 32, 40, 64, 80
Gen4:8、16、24Gen4: 8, 16, 24
Gen5:4、8、16、24Gen5: 4, 8, 16, 24
*相同数量的 vCore 专用于只读查询。*Same number of vCores is dedicated for read-only queries.
最大内存Max memory Gen4:56 GB - 168 GB (7GB/vCore)Gen4: 56 GB - 168 GB (7GB/vCore)
Gen5:20.4 GB - 408 GB (5.1GB/vCore)Gen5: 20.4 GB - 408 GB (5.1GB/vCore)
添加更多 Vcore 以获得更多内存。Add more vCores to get more memory.
Gen4:56 GB - 168 GB (7GB/vCore)Gen4: 56 GB - 168 GB (7GB/vCore)
Gen5:为读写查询提供 20.4 GB - 112.4 GB (5.1GB/vCore)Gen5: 20.4 GB - 112.4 GB (5.1GB/vCore) for read-write queries
为只读查询额外提供 20.4 GB - 112.4 GB (5.1GB/vCore)。+ additional 20.4 GB - 112.4 GB (5.1GB/vCore) for read-only queries.
添加更多 vCore 以获得更多内存。Add more vCores to get more memory.
最大实例存储大小(预留)Max instance storage size (reserved) - 4 个 vCore 2 TB(仅限 Gen5)- 2 TB for 4 vCores (Gen5 only)
- 8 TB,适用于其他大小- 8 TB for other sizes
Gen4:1 TBGen4: 1 TB
- 1 TB,适用于 4、8、16 个 vCore- 1 TB for 4, 8, 16 vCores
- 2 TB(适用于 24 个 vCore)- 2 TB for 24 vCores
最大数据库大小Max database size 不超过当前可用的实例大小(最大为 2 TB - 8 TB,具体取决于 vCore 数)。Up to currently available instance size (max 2 TB - 8 TB depending on the number of vCores). 不超过当前可用的实例大小(最大为 1 TB - 2 TB,具体取决于 vCore 数)。Up to currently available instance size (max 1 TB - 2 TB depending on the number of vCores).
最大 tempDB 大小Max tempDB size 限制为 24 GB/vCore (96 - 1,920 GB) 和当前可用的实例存储大小。Limited to 24 GB/vCore (96 - 1,920 GB) and currently available instance storage size.
添加更多 Vcore 以获得更多 TempDB 空间。Add more vCores to get more TempDB space.
日志文件大小限制为 120 GB。Log file size is limited to 120 GB.
不超过当前可用的实例存储大小。Up to currently available instance storage size.
每个实例的数据库数目上限Max number of databases per instance 除非已达到实例存储大小限制,否则为 100。100, unless the instance storage size limit has been reached. 除非已达到实例存储大小限制,否则为 100。100, unless the instance storage size limit has been reached.
每个实例的数据库文件数上限Max number of database files per instance 除非已达到实例存储大小或 Azure 高级磁盘存储分配空间限制,否则最大为 280。Up to 280, unless the instance storage size or Azure Premium Disk storage allocation space limit has been reached. 除非已达到实例存储大小限制,否则为每个数据库 32,767 个文件。32,767 files per database, unless the instance storage size limit has been reached.
最大数据文件大小Max data file size 限制为当前可用的实例存储大小(最大 2 TB - 8 TB)和 Azure 高级磁盘存储分配空间Limited to currently available instance storage size (max 2 TB - 8 TB) and Azure Premium Disk storage allocation space. 限制为当前可用的实例存储大小(最大为 1 TB - 2 TB)。Limited to currently available instance storage size (up to 1 TB - 2 TB).
最大日志文件大小Max log file size 限制为 2 TB 和当前可用的实例存储大小。Limited to 2 TB and currently available instance storage size. 限制为 2 TB 和当前可用的实例存储大小。Limited to 2 TB and currently available instance storage size.
数据/日志 IOPS(近似值)Data/Log IOPS (approximate) 每个实例最多 30-40 K IOPS*,每个文件 500 - 7500Up to 30-40 K IOPS per instance*, 500 - 7500 per file
*增加文件大小以获得更多 IOPS*Increase file size to get more IOPS
10 K - 200 K (2500 IOPS/vCore)10 K - 200 K (2500 IOPS/vCore)
添加更多 Vcore 以获得更好的 IO 性能。Add more vCores to get better IO performance.
日志写入吞吐量限制(每个实例)Log write throughput limit (per instance) 3 MB/s(每个 vCore)3 MB/s per vCore
最大 22 MB/sMax 22 MB/s
4 MB/s(每个 vCore)4 MB/s per vCore
最大 48 MB/sMax 48 MB/s
数据吞吐量(近似值)Data throughput (approximate) 100 - 250 MB/s(每个文件)100 - 250 MB/s per file
*增加文件大小以获得更好的 IO 性能*Increase the file size to get better IO performance
无限制。Not limited.
存储 IO 延迟(近似)Storage IO latency (approximate) 5-10 毫秒5-10 ms 1-2 毫秒1-2 ms
内存中 OLTPIn-memory OLTP 不支持Not supported 可用大小取决于 vCore 数Available, size depends on number of vCore
最大会话数Max sessions 3000030000 3000030000
最大并发工作线程数(请求数)Max concurrent workers (requests) Gen4:210 * vCore 数目 + 800Gen4: 210 * number of vCores + 800
Gen5:105 * vCore 数目 + 800Gen5: 105 * number of vCores + 800
Gen4:210 * vCore 计数 + 800Gen4: 210 * vCore count + 800
Gen5:105 * vCore 计数 + 800Gen5: 105 * vCore count + 800
只读副本Read-only replicas 00 1(包括在价格中)1 (included in price)
计算隔离Compute isolation Gen5:Gen5:
-支持 80 个 vCore-supported for 80 vCores
-不支持其他大小-not supported for other sizes

由于弃用,不支持 Gen4Gen4 is not supported due to deprecation
不支持not supported

一些其他注意事项:A few additional considerations:

  • 当前可用实例存储大小是预留实例大小与已用存储空间之差。Currently available instance storage size is the difference between reserved instance size and the used storage space.
  • 与最大存储大小限制进行比较的实例存储大小同时包括用户数据库和系统数据库中的数据和日志文件大小。Both data and log file size in the user and system databases are included in the instance storage size that is compared with the max storage size limit. 可以使用 sys.master_files 系统视图来确定数据库使用的空间总量。Use the sys.master_files system view to determine the total used space by databases. 错误日志不会持久保存,不包括在大小中。Error logs are not persisted and not included in the size. 备份不包括在存储大小中。Backups are not included in storage size.
  • 常规用途层上的吞吐量和 IOPS 还要取决于未显式受到 SQL 托管实例限制的文件大小Throughput and IOPS in the General Purpose tier also depend on the file size that is not explicitly limited by the SQL Managed Instance. 可以使用自动故障转移组在不同的 Azure 区域中创建另一个可读副本You can create another readable replica in a different Azure region using auto-failover groups
  • 最大实例 IOPS 取决于工作负荷的文件布局和分布。Max instance IOPS depend on the file layout and distribution of workload. 例如,如果创建 7 个 1 TB 文件(每个文件最大 5K IOPS)和 7 个小文件(小于 128 GB,每个文件 500 IOPS),并且工作负载可以使用所有文件,则每个实例可以处理 38500 IOPS (7x5000+7x500)。As an example, if you create 7 x 1TB files with max 5K IOPS each and 7 small files (smaller than 128 GB) with 500 IOPS each, you can get 38500 IOPS per instance (7x5000+7x500) if your workload can use all files. 请注意,某些 IOPS 还将用于自动备份。Note that some IOPS is also used for auto-backups.

“常规用途”层级中的文件 IO 特征File IO characteristics in General Purpose tier

在常规用途服务层中,每个数据库文件都将获得专用 IOPS 和吞吐量,具体取决于文件大小。In the General Purpose service tier every database file gets dedicated IOPS and throughput that depend on the file size. 较大的数据文件会获得更多的 IOPS 和吞吐量。Bigger data files get more IOPS and throughput. 下表显示了数据库文件的 IO 特征:IO characteristics of the database files are shown in the following table:

文件大小File size >=0 且 <=128 GiB>=0 and <=128 GiB >128 且 <=256 GiB>128 and <=256 GiB >256 且 <= 512 GiB>256 and <= 512 GiB >0.5 且 <=1 TiB>0.5 and <=1 TiB >1 且 <=2 TiB>1 and <=2 TiB >2 且 <=4 TiB>2 and <=4 TiB >4 且 <=8 TiB>4 and <=8 TiB
每个文件的 IOPSIOPS per file 500500 11001100 23002300 50005000 75007500 75007500 12,50012,500
每个文件的吞吐量Throughput per file 100 MiB/秒100 MiB/s 125 MiB/秒125 MiB/s 150 MiB/秒150 MiB/s 200 MiB/秒200 MiB/s 250 MiB/秒250 MiB/s 250 MiB/秒250 MiB/s 480 MiB/秒480 MiB/s

如果注意到某个数据库文件的 IO 延迟较高,或者发现 IOPS/吞吐量即将达到限制,可以通过增大文件大小来提高性能。If you notice high IO latency on some database file or you see that IOPS/throughput is reaching the limit, you might improve performance by increasing the file size.

最大日志写入吞吐量也存在实例级别的限制(即 22 MB/秒),因此,你可能无法达到日志文件的最大文件吞吐量,因为你即将达到实例吞吐量限制。There is also an instance-level limit on the max log write throughput (which is 22 MB/s), so you may not be able to reach the max file throughout on the log file because you are hitting the instance throughput limit.

支持的区域Supported regions

SQL 托管实例只能在支持的区域中创建。SQL Managed Instance can be created only in supported regions. 若要在当前不支持的区域中创建 SQL 托管实例,可以发送支持请求To create a SQL Managed Instance in a region that is currently not supported, you can send a support request.

区域资源限制Regional resource limitations

支持的订阅类型可以包含每个区域的有限数量的资源。Supported subscription types can contain a limited number of resources per region. 对于每个 Azure 区域,SQL 托管实例有两个默认限制(可以通过创建特殊支持请求来按需提高),具体取决于订阅类型是哪一类型:SQL Managed Instance has two default limits per Azure region (that can be increased on-demand by creating a special support request depending on a type of subscription type:

  • 子网限制:在单个区域中部署 SQL 托管实例的实例的子网数目上限。Subnet limit: The maximum number of subnets where instances of SQL Managed Instance are deployed in a single region.
  • vCore 单元限制:可跨单一区域的所有实例部署的 vCore 单元数上限。vCore unit limit: The maximum number of vCore units that can be deployed across all instances in a single region. 一个 GP vCore 使用一个 vCore 单元,一个 BC vCore 采用 4 个 vCore 单位。One GP vCore uses one vCore unit and one BC vCore takes 4 vCore units. 实例总数不受限制,只要在 vCore 单元限制内即可。The total number of instances is not limited as long as it is within the vCore unit limit.


这些限制是默认设置,不是技术限制。These limits are default settings and not technical limitations. 如果在当前区域中需要更多实例,可以创建特殊支持请求,以根据需要提高限制。The limits can be increased on-demand by creating a special support request if you need more instances in the current region. 或者,可以在另一个 Azure 区域中创建 SQL 托管实例的新实例,而无需发送支持请求。As an alternative, you can create new instances of SQL Managed Instance in another Azure region without sending support requests.

后续步骤Next steps