简体   繁体   English

我怎么知道Azure VIP交换何时完成?

[英]How can I know when an Azure VIP swap is finished?

I just did a VIP swap using the management REST API. 我只是使用管理REST API进行了VIP交换。 It took 30s before the operation returned the status code "Succeeded", but it was another minute or so before requests to the service started returning new content. 该操作花了30秒钟才返回状态代码“成功”,但又过了大约一分钟,才向服务请求开始返回新内容。 Because I need to manage slow-to-start processes, I need to notify my worker roles before and after a VIP swap. 因为我需要管理启动缓慢的流程,所以需要在VIP交换之前和之后通知我的工作人员角色。 So the question is this: how can I be confident that a VIP swap has finished? 所以问题是这样的:我如何确定VIP交换已完成? If I start getting content back from the new deployment, how long should I wait before taking action? 如果我开始从新的部署中获取内容,我应该等待多长时间才能采取行动? That is, do all web roles get swapped close-to-simultaneously? 也就是说,是否所有Web角色都被同时接近交换? This thread reports old content being returned for up to 30 minutes, but I find that hard to believe. 该线程报告旧内容最多返回30分钟,但是我很难相信。 Perhaps they had caching or proxies in place. 也许他们有缓存或代理。

The actual VIP swap should never take more than on the order of tens of seconds, so "just wait a minute" would work fine. 实际的VIP交换所花的时间不应超过几十秒,因此“只需等待一分钟”即可正常工作。 That said, existing connections can persist for quite some time. 也就是说, 现有连接可以保留相当长的时间。 If you're refreshing in the same browser over and over, you may manage to hold a single TCP socket open (due to HTTP keep-alive). 如果您要在同一浏览器中反复刷新,则可能会设法保持打开一个TCP套接字(由于HTTP保持活动状态)。 Despite the VIP swap, the socket is still open and connected to the old deployment. 尽管交换了VIP,该套接字仍处于打开状态并连接到旧的部署。

So how long it takes depends on what it is you're trying to measure. 因此,需要多长时间取决于您要测量的内容。 The process of reprogramming the load balancer to point to the new deployment is quite fast. 重新编程负载均衡器以指向新部署的过程非常快。 The process of all users disconnecting and establishing a new connection (and their caches being flushed, etc.) could take longer. 所有用户断开连接并建立新连接(以及清除其缓存等)的过程可能需要更长的时间。

I do not know the precise answer to your question with respect to the actual physical action of doing a VIP swap on the Azure side. 对于在Azure端进行VIP交换的实际物理操作,我不知道您的问题的确切答案。 However, when the swap occurs, DNS name change takes sometime to propagate. 但是,发生交换时,DNS名称更改需要一段时间才能传播。 Even if your TTL (time to live) is relatively small. 即使您的TTL(生存时间)相对较小。 This is because most ISP's cache DNS resolution on their own servers as well and by the time a new IP is resolving to the old name, all sorts of DNS caching has to refresh 这是因为大多数ISP也在其自己的服务器上缓存DNS解析,并且当新IP解析为旧名称时,各种DNS缓存都必须刷新

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

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