请求限制策略(预览)Request limits policy (Preview)

工作负荷组的请求限制策略允许限制请求在其执行过程中使用的资源。A workload group's request limits policy allows limiting the resources used by the request during its execution.

策略对象The policy object

每个限制包括:Each limit consists of:

  • 键入的 Value - 限制的值。A typed Value - the value of the limit.
  • IsRelaxable - 一个布尔值,作为请求的客户端请求属性的一部分,它定义了调用方是否可以放宽限制。IsRelaxable - a boolean value that defines if the limit can be relaxed by the caller, as part of the request's Client request properties.

以下限制是可配置的:The following limits are configurable:

名称Name 类型Type 说明Description 支持的值Supported values 匹配客户端请求属性Matching client request property
DataScopeDataScope QueryDataScope 查询的数据范围 - 查询是应用于所有数据还是仅应用于数据的“热”部分。The query's data scope - whether the query applies to all data or just the 'hot' portion of it. AllHotCachenullAll, HotCache, or null query_datascope
MaxMemoryPerQueryPerNodeMaxMemoryPerQueryPerNode long 查询可分配的最大内存量。The maximum amount of memory a query can allocate. [1,单节点总 RAM 的 50%][1, 50% of a single node's total RAM] max_memory_consumption_per_query_per_node
MaxMemoryPerIteratorMaxMemoryPerIterator long 查询运算符可分配的最大内存量。The maximum amount of memory a query operator can allocate. [1,单节点总 RAM 的 50%][1, 50% of a single node's total RAM] maxmemoryconsumptionperiterator
MaxFanoutThreadsPercentageMaxFanoutThreadsPercentage int 每个节点上要扇出查询执行的线程的百分比。The percentage of threads on each node to fan out query execution to. 如果设置为 100%,则群集将分配每个节点上的所有 CPU。When set to 100%, the cluster will assign all CPUs on each node. 例如,Azure D14_v2 节点上部署的某个群集上的 16 个 CPU。For example, 16 CPUs on a cluster deployed on Azure D14_v2 nodes. [1, 100][1, 100] query_fanout_threads_percent
MaxFanoutNodesPercentageMaxFanoutNodesPercentage int 群集上要扇出查询执行的节点的百分比。The percentage of nodes on the cluster to fan out query execution to. 函数的使用方式类似于 MaxFanoutThreadsPercentageFunctions in a similar manner to MaxFanoutThreadsPercentage. [1, 100][1, 100] query_fanout_nodes_percent
MaxResultRecordsMaxResultRecords long 允许请求返回到调用方的最大记录数,超过该数目的结果将被截断。maximum number of records a request is allowed to return to the caller, above which the results are truncated. [1, 9223372036854775807][1, 9223372036854775807] truncationmaxrecords
MaxResultBytesMaxResultBytes long 允许请求返回到调用方的最大数据大小(以字节为单位),超过该数目的结果将被截断。The maximum data size (in bytes) a request is allowed to return to the caller, above which the results are truncated. [1, 9223372036854775807][1, 9223372036854775807] truncationmaxsize
MaxExecutionTimeMaxExecutionTime timespan 请求可以运行的最长时间。The maximum duration the request may run for. (00:00:00, 01:00:00](00:00:00, 01:00:00] servertimeout

注释Notes

  • 未定义或定义为 null 的限制,取自 default 工作负荷组的请求限制策略。A limit that isn't defined, or is defined as null, is taken from the default workload group's request limits policy.
  • 更改 default 工作负荷组的策略时,必须定义一个限制,并将其设置为非 null 值。When altering the policy for the default workload group, a limit must be defined and have a non-null value.
  • 为了实现后向兼容性:对于分类到 default 工作负荷组的导出命令或从查询引入的命令(例如 .set-or-append.set-or-replace),将禁用请求限制,并且不应用策略中设置的限制。For backwards compatibility: For export commands or ingest-from-query commands (such as .set-or-append and .set-or-replace) that are classified to the default workload group, requests limits are disabled, and limits set in the policy don't apply.
    • 但是,如果这些命令分类到非默认的工作负荷组,则将应用策略中的限制。However, if these commands are classified to a non-default workload group, the limits in the policy do apply.

示例Example

{
  "DataScope": {
    "IsRelaxable": true,
    "Value": "HotCache"
  },
  "MaxMemoryPerQueryPerNode": {
    "IsRelaxable": true,
    "Value": 2684354560
  },
  "MaxMemoryPerIterator": {
    "IsRelaxable": true,
    "Value": 2684354560
  },
  "MaxFanoutThreadsPercentage": {
    "IsRelaxable": true,
    "Value": 50
  },
  "MaxFanoutNodesPercentage": {
    "IsRelaxable": true,
    "Value": 50
  },
  "MaxResultRecords": {
    "IsRelaxable": true,
    "Value": 1000
  },
  "MaxResultBytes": {
    "IsRelaxable": true,
    "Value": 33554432
  },
  "MaxExecutiontime": {
    "IsRelaxable": true,
    "Value": "00:01:00"
  }
}

default 工作负荷组The default workload group

默认情况下,default 工作负荷组定义了以下策略。The default workload group has the following policy defined by default. 此策略可修改。This policy can be altered.

{
  "DataScope": {
    "IsRelaxable": true,
    "Value": "All"
  },
  "MaxMemoryPerQueryPerNode": {
    "IsRelaxable": true,
    "Value": < 50% of a single node's total RAM >
  },
  "MaxMemoryPerIterator": {
    "IsRelaxable": true,
    "Value": 5368709120
  },
  "MaxFanoutThreadsPercentage": {
    "IsRelaxable": true,
    "Value": 100
  },
  "MaxFanoutNodesPercentage": {
    "IsRelaxable": true,
    "Value": 100
  },
  "MaxResultRecords": {
    "IsRelaxable": true,
    "Value": 500000
  },
  "MaxResultBytes": {
    "IsRelaxable": true,
    "Value": 67108864
  },
  "MaxExecutiontime": {
    "IsRelaxable": true,
    "Value": "00:04:00"
  }
}

控制命令Control commands

通过工作负荷组控制命令管理工作负荷组的请求限制策略。Manage the workload group's request limits policy with Workload groups control commands.