简体   繁体   中英

Max out Azure SQL DTU with SQL inside code, but not from SQL Server Management Studio

I have a bit a funny situation. Our Azure SQL instance maxes out at 100 DTU for a certain query and the query returns a timeout:

SqlException (0x80131904): Timeout expired.  The timeout period
elapsed prior to completion of the operation or the server is not
responding.  This failure occurred while attempting to connect to the
routing destination.

If I run exactly the same query (with the parameters hardcoded) in SQL Server Management Studio it still takes the DTU up to 25%, but that's still far away from 100%. Nothing else runs on that server. There are a few other queries that run before/after. But if we just run them, nothing spikes out.

Any ideas?

My analysis of the issue goes like this..

First when DTU's are maxed out and if a query fails due to that,you will not get time out..Below is the error message you will get..

Resource ID: %d. The %s limit for the database is %d and has been reached. For more information

You can try testing that by opening multiple resource intensive queries

Secondly when you get time out's as indicated in your question,this is mostly due to query waiting for resources like say some database IO,memory..

we faced similar time out's ,but most of them are fixed by updating stats and rebuilding indexes,rest of them we optimized

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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