Azure数据库在使用Visual Studio 2022进行本地调试时变慢。

huangapple go评论66阅读模式
英文:

Azure Database database is slow when locally debugging in VS 2022

问题

我正在与我的团队解决一个问题,我们正在使用Azure SQL数据库作为服务。

在一个示例中:

  • 通过Azure应用服务连接到Azure数据库:调用需要350毫秒
  • 通过我们工作计算机上的VS 2022连接到Azure数据库:调用需要2.5秒
  • 在我们工作计算机上本地连接到bacpac数据库(来自Azure数据库):调用需要350毫秒

我们已经做了以下事情:

  • 将定价层从弹性池更改为标准S2:50个DTU -> 仍然存在相同的缓慢
  • 更改Azure数据库的位置
  • 优化了一些调用(有帮助,但本地数据库和Azure数据库之间仍然存在很大差异)

我们认为这可能与我们向服务器发出的整体特定调用有关,我们正在为每个调用对数据库进行X次调用并打开连接?

仍然不清楚为什么在本地工作得如此快,但是在开发时连接到Azure数据库时如此缓慢。

此外,似乎这曾经不是问题。我们认为可能是我们工作VPN的更改引起了问题,但是我们已经在VPN上进行了测试,问题仍然很慢连接到Azure数据库。

有什么想法吗?

英文:

I'm working on an issue with my team where we are using Azure SQL Database as a service.

In one example:

  • Connecting to azure database via azure app service: call takes 350 ms
  • Connecting to azure database via VS 2022 on our work computers: call takes 2.5 seconds
  • Connecting to a bacpac database (from the azure database) locally on sql server on our work computers: call takes 350 milliseconds

Things we have done:

  • Change the pricing tier from elastic pool to Standard S2: 50 DTUs -> still the same slowness
  • Changed the location of the azure database
  • Optimized some of the calls (helps, but we still see a big difference between local db and azure database)

We believe it could have something to do with the overall specific call to the server where we are making X calls to the database and opening a connection for each one?

Still doesn't seem to make sense of why it works so fast locally, but then when we connect to the azure database while developing it is so slow.

Also, it seems that this USE to not be the issue. We thought maybe a change in our work VPN could have caused it, but we've tested off the VPN and the issue still is slow connecting to the azure database.

Any thoughts?

答案1

得分: 0

解决方案:

问题与我们公司的工作 VPN 相关。

已设置分流隧道以解决工作站到 Azure 数据库流量的问题。(现在不再通过 VPN 网络进行评估)。

英文:

Solution:

The issue was tied to our company work VPN.

A split-tunnel was setup to resolve the issue for the workstation to azure db traffic. (It is not evaluated via the VPN network now).

huangapple
  • 本文由 发表于 2023年6月22日 11:20:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76528408.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定