如何在Azure Function App服务中限制DB CPU I/O? [英] How to restrict DB CPU I/O in Azure Function App service?

查看:112
本文介绍了如何在Azure Function App服务中限制DB CPU I/O?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在对应用程序执行负载测试,并监视请求数和CPU I/O.我注意到在某个时刻,我的应用程序服务中数据库的CPU I/O接近100%,这导致很多SqlException表示数据库限制 是2000年,已经达到.尽管我的计划是具有20个vCore的关键业务",并且我已在连接字符串中将池大小硬编码为3000,但仍然出现此错误.需要帮助.

I am performing load test on my application and monitoring the number of requests and CPU I/O. I have noticed that at some point the CPU I/O of my DB in my app service reaches close to 100% which results in a lot of SqlException saying the database limit is 2000 and has been reached. Although my plan is Business Critical with 20 vCores and I have hard coded the pool size to be 3000 in my connection string, I am still getting this error. Need help.

推荐答案

你好,

Hello,

https://azure .microsoft.com/en-us/services/cache/


https://azure.microsoft.com/en-us/services/cache/


Can you examine the way you are opening connections to the database? Are all those connections needed? Is there any layer opening many connections from within each transaction and for any reason they stay opened, they are not closed?

Do you see there are loops within transactions? Try saving transactions like below:


transactions.ForEach(t => await _sqlService.SaveBusinessTransaction(t));



Could you try setting max degree of parallelism for the database to 1?


ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 1;

The following article may be useful:

https://blogs.technet.microsoft.com/latam/2015/06/01/how-to-deal-使用Azure SQL数据库最大登录限制/

https://blogs.technet.microsoft.com/latam/2015/06/01/how-to-deal-with-the-limits-of-azure-sql-database-maximum-logins/


Hope this helps.


Regards,

Alberto Morillo
SQLCoffee.com


这篇关于如何在Azure Function App服务中限制DB CPU I/O?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆