简体   繁体   English

如何对在登台和生产中同时运行的Azure诊断执行自动缩放?

[英]How to perform Autoscaling with Azure diagnostics running in both Staging and Production?

I have set up Azure autoscaling based on Azure diagnostics of my website. 我已基于网站的Azure诊断设置了Azure自动缩放。

Since Staging and Production are just exact copies of each other, both Staging and Production store diagnostics to the SAME WadPerformanceCountersTable. 由于暂存和生产只是彼此的精确副本,因此暂存和生产都将诊断存储到SAME WadPerformanceCountersTable。

While I know I can differentiate between Staging and Production slots by using the DeploymentId, does Azure autoscaling make this differentiation as well? 虽然我知道我可以使用DeploymentId区分登台和生产插槽,但Azure自动缩放是否也可以实现这种区分? If so, how? 如果是这样,怎么办?

If not, how do I set up Azure Diagnostics and Autoscaling to only Autoscale Production based only on Production data? 如果没有,如何将Azure诊断和自动缩放设置为仅基于生产数据自动缩放生产?

Edit: I ran another test which scaled with a reactive rule for both production and staging. 编辑:我运行了另一个测试,该测试使用生产和暂存的反应式规则进行缩放。 The Autoscaler can differentiate between staging and production. Autoscaler可以区分暂存和生产。 I would assume it can differentiate between different deployments as well. 我认为它也可以区分不同的部署。

However the information in this post is useful for anyone who wants to remotely control diagnostics for multiple sites. 但是,此信息对希望远程控制多个站点的诊断的人很有用。


I do not believe Azure Autoscaling differentiates between Production and Staging, let alone different sites. 我不认为Azure自动缩放在生产和暂存之间有所区别,更不用说不同的站点了。 My reasoning is that I was able to autoscale one website using diagnostics from a completely different website. 我的理由是,我能够使用来自完全不同的网站的诊断信息来自动缩放一个网站。

As for how to differentiate between Staging and Production, here are some definitions to help make sense of the following answer: 至于如何区分暂存和生产,以下是一些定义,以帮助理解以下答案:

  • Autoscaler = worker role doing the autoscaling Autoscaler =执行自动缩放的辅助角色
  • Target Site = the site to be scaled 目标站点=要扩展的站点

Originally, I thought I would have to call on the Azure Service Management API within my Target Site to periodically check if it was staging or not. 最初,我以为我必须在目标站点内调用Azure服务管理API来定期检查它是否处于暂存状态。 This is not a good answer because it is best practice to ensure that production and staging are EXACTLY the same. 这不是一个很好的答案,因为最佳实践是确保生产和阶段完全相同。

Then I realized I could "disable" diagnostics on the sites remotely by editing their diagnostic configurations to stop gathering data in my Autoscaler. 然后我意识到,可以通过编辑站点的诊断配置以停止在Autoscaler中收集数据来远程“禁用”站点上的诊断。 The autoscaler would know which deployments were staging and production based on their deploymentId. 自动伸缩器将根据它们的deploymentId知道正在部署和生产的部署。 Using this information, we can easily switch diagnostics on or off by setting it to the default configuration. 使用此信息,我们可以通过将诊断设置为默认配置来轻松地打开或关闭诊断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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