在Azure VM上从本地SQL切换到Azure SQL数据库 - 降低性能

时间:2021-12-05 16:56:22

Currently I am hosting my online application on an Azure VM. This is a pretty standard Umbraco website with around 300 visitors per day, nothing special here.

目前,我正在Azure VM上托管我的在线应用程序。这是一个非常标准的Umbraco网站,每天有大约300名访客,这里没什么特别的。

Details of Azure VM: - Basic A3 - 4 cores - 7 GB Memory

Azure VM的详细信息: - 基本A3 - 4核 - 7 GB内存

In the current situation MsSQL is installed on the VM itself and this is working fine, but I am not a great expert in maintenance. A solution I found is migrating the SQL database to SQL Azure.

在目前的情况下,MsSQL安装在VM本身上,这很好,但我不是一个很好的维护专家。我发现的解决方案是将SQL数据库迁移到SQL Azure。

Looking at my current website I decided to do this and I migrated the database to SQL Azure: - S3 Standard - 100 DTU - 250GB

看看我当前的网站,我决定这样做,并将数据库迁移到SQL Azure: - S3 Standard - 100 DTU - 250GB

After the migration I switched the connection string with the connection string that was provided in the Azure portal. When I reloaded my website the loading time was suddenly three times slower.

迁移后,我使用Azure门户中提供的连接字符串切换连接字符串。当我重新加载我的网站时,加载时间突然慢了三倍。

For now I switched it back to the local SQL Database, but I am wondering if it is a normal situation that the local SQL is faster then SQL Azure in this case.

现在我将其切换回本地SQL数据库,但我想知道在这种情况下本地SQL是否比SQL Azure更快是正常情况。

I hope someone can answer my question, please let me know if more information is required to answer my question.

我希望有人能回答我的问题,如果需要更多信息来回答我的问题,请告诉我。

Best regards, Martijn

最好的问候,Martijn

EDIT The issue is resolved! I found out that the SQL Azure Server that I created was located in a different region then the Azure VM. After I created a new SQL Azure server in the same region the performance issues where fixed.

编辑问题已解决!我发现我创建的SQL Azure服务器位于与Azure VM不同的区域。在同一区域中创建新的SQL Azure服务器之后,性能会在修复后出现问题。

1 个解决方案

#1


1  

Good to hear your perf issues are fixed. In general, comparing the performance of a local database versus a PaaS database is not always an apples-to-apples comparison for a number of reasons:

很高兴听到您的性能问题得到解决。通常,比较本地数据库与PaaS数据库的性能并不总是一对一的比较,原因如下:

  • Azure SQL Database is a highly available service (99.99%) that requires synchronous commits to a secondary database. A local database typically is not configured for high availability.
  • Azure SQL数据库是一种高可用性服务(99.99%),需要同步提交到辅助数据库。通常,未配置本地数据库以实现高可用性。

  • Azure SQL Database provides automatic backup. Depending on your setup, a local database might may or may not be configured for backup.
  • Azure SQL数据库提供自动备份。根据您的设置,可能可能配置本地数据库,也可能不配置本地数据库进行备份。

  • The affect of network latency on a local database does not exist
  • 网络延迟对本地数据库的影响不存在

  • The memory and CPU between of a S3 Azure SQL Database and a A3 VM are likely not the same
  • S3 Azure SQL数据库和A3 VM之间的内存和CPU可能不同

#1


1  

Good to hear your perf issues are fixed. In general, comparing the performance of a local database versus a PaaS database is not always an apples-to-apples comparison for a number of reasons:

很高兴听到您的性能问题得到解决。通常,比较本地数据库与PaaS数据库的性能并不总是一对一的比较,原因如下:

  • Azure SQL Database is a highly available service (99.99%) that requires synchronous commits to a secondary database. A local database typically is not configured for high availability.
  • Azure SQL数据库是一种高可用性服务(99.99%),需要同步提交到辅助数据库。通常,未配置本地数据库以实现高可用性。

  • Azure SQL Database provides automatic backup. Depending on your setup, a local database might may or may not be configured for backup.
  • Azure SQL数据库提供自动备份。根据您的设置,可能可能配置本地数据库,也可能不配置本地数据库进行备份。

  • The affect of network latency on a local database does not exist
  • 网络延迟对本地数据库的影响不存在

  • The memory and CPU between of a S3 Azure SQL Database and a A3 VM are likely not the same
  • S3 Azure SQL数据库和A3 VM之间的内存和CPU可能不同