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?
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With