简体   繁体   English

数据库的请求限制为30且已达到:此错误的请求计数的状态是多少?

[英]The request limit for the database is 30 and has been reached: which statuses of request count for this error?

I got this error when try to call SQL queries inside a Function App. 尝试在Function App中调用SQL查询时出现此错误。 My plan is get the number of current active request to avoid the limit request error above. 我的计划是获取当前活动请求的数量以避免上面的限制请求错误。 I saw that SQL request has these statuses: dormant, running, background, rollback, pending, runnable, spinloop, suspended. 我看到SQL请求具有以下状态:休眠,运行,后台,回滚,挂起,可运行,spinloop,暂停。

Do you guys knows which statuses that the limit error count? 你们知道限制错误计数的状态吗?

You can run the following queries: 您可以运行以下查询:

-- Run on master
SELECT * FROM sys.resource_stats ORDER BY end_time DESC;  

or 要么

SELECT * FROM sys.dm_db_resource_stats ORDER BY end_time DESC; 

You can examine max_session_percent and max_worker_percent values on those queries. 您可以检查这些查询的max_session_percent和max_worker_percent值。

My suggestion is to add OPTION (MAXDOP 1) to your queries or set maximum degree of parallelism at the database level. 我的建议是在您的查询中添加OPTION(MAXDOP 1)或在数据库级别设置最大并行度。

ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 1;

"The request limit for the database is 30 and has been reached" “数据库的请求限制为30,已达到”

The status that most likely relates to request count regarding the above error, or rather that you should look at, would be "running" - tasks that are currently being processed. 与上述错误相关的请求计数最有可能的状态,或者您应该查看的状态,将“正在运行” - 当前正在处理的任务。 All workers are busy until their task is completed and cannot pick up a pending task, so incoming requests that would create new pending tasks will not be accepted. 所有工作人员都忙着,直到他们的任务完成并且无法接收待处理任务,因此将不会接受将创建新待处理任务的传入请求。

"The maximum number of sessions and workers are determined by the service tier and compute size (DTUs and eDTUs). New requests are rejected when session or worker limits are reached, and clients receive an error message." “最大会话数和工作数由服务层和计算大小(DTU和eDTU)决定。当达到会话或工作人员限制时,新请求将被拒绝,并且客户端会收到错误消息。”

The error doesn't mean you have to increase the max. 该错误并不意味着您必须增加最大值。 The function app could be making too many calls. 功能应用可能会拨打太多电话。 Or there might be poor performing queries that are hogging resources resulting in long completion times. 或者可能存在性能不佳的查询,这些查询会占用资源,从而导致完成时间过长。

If you want to increase the max, for Azure SQL database, the next tier up from Basic would be Standard/S0 with 60 concurrent workers (requests). 如果要增加最大值,对于Azure SQL数据库,Basic的下一层将是Standard / S0,其中包含60个并发工作程序(请求)。 You can see all the tiers and their limits here . 您可以在此处查看所有层级及其限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM