Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

Do you guys knows which statuses that the limit error count?

like image 272
Nam Vũ Avatar asked Sep 11 '25 03:09

Nam Vũ


1 Answers

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.

My suggestion is to add OPTION (MAXDOP 1) to your queries or set maximum degree of parallelism at the database level.

ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 1;
like image 135
Alberto Morillo Avatar answered Sep 13 '25 18:09

Alberto Morillo