简体   繁体   English

为什么Azure给我一个间歇性的错误503.该服务不可用?

[英]Why does Azure give me an intermittent Error 503. The service is unavailable?

I have an Azure service that has been running for a long period of time. 我有一个已经运行了很长一段时间的Azure服务。 It builds a word or powerpoint document based on arguments in the request and returns a uri to the build document. 它根据请求中的参数构建word或powerpoint文档,并将uri返回到构建文档。 This is access via a visualforce page, when you click a button, it calls the service and displays a link to the document that has just been built. 这是通过visualforce页面进行访问,当您单击按钮时,它会调用服务并显示刚刚构建的文档的链接。 Simple. 简单。

All of a sudden, I get an apparently random 503 Service Unavailable error. 突然之间,我得到了一个明显随机的503 Service Unavailable错误。 Sometimes I click the button, no problem. 有时我点击按钮,没问题。 Other times a 503 error. 其他时间503错误。 Each time the button triggers exactly the same request. 每次按钮触发完全相同的请求。 Does anyone know why this might be happening? 有谁知道为什么会发生这种情况?

Apparently doing the same thing over and over again and expecting a different result, is not insanity! 显然,一遍又一遍地做同样的事情,期待不同的结果,不是疯狂!

Thanks for taking the time to read this. 感谢您抽时间阅读。

Looking at the monitoring on my service told me the processor was never exceeding 6% of usage, so it couldn't be a lack of resource causing these intermittent 503 errors. 看看我的服务监控告诉我处理器的使用率从未超过6%,因此不能缺少导致这些间歇性503错误的资源。 It's bizarre and I'm afraid I have no explanation for it, but simply redeploying the cloud service to Azure appears to have done the trick. 这很奇怪,我担心我没有解释,但只是将云服务重新部署到Azure似乎已经成功了。 It now works perfectly. 它现在完美无缺。 The solution has not changed, so I can only imagine that whatever 'reboot' is necessary after deployment, has rectified whatever the problem was. 解决方案没有改变,所以我只能想象在部署之后需要“重启”的任何事情,已经纠正了问题所在。 All I can suggest is that you try the same thing if you are getting intermittent 503 errors. 我所能建议的是,如果你得到间歇性的503错误,你会尝试同样的事情。

For me the error went away when I set up auto-scaling. 对我来说,当我设置自动缩放时,错误就消失了。 I think failover requests were getting routed to my second VM, and the second VM took some time to spin up because it wasn't ready for the activity. 我认为故障转移请求被路由到我的第二个VM,第二个VM需要一些时间才能启动,因为它还没有为活动做好准备。 Auto-scaling shut down my second VM and the error no longer appears (I'm assuming it will spin up if/when I get enough traffic to use it). 自动缩放关闭了我的第二个虚拟机并且错误不再出现(我假设如果/当我获得足够的流量来使用它时它会旋转)。

Hope this also helps someone. 希望这也有助于某人。

I get this error whenever I create an Azure Function with a storage account in the South Central US. 每当我在美国中南部使用存储帐户创建Azure功能时,我都会收到此错误。 If I use a storage account in a different region the function works. 如果我在不同区域使用存储帐户,则该功能有效。

Try a storage account in a different region than the one you are currently using to see if it resolves your issue. 尝试使用与您当前使用的区域不同的区域中的存储帐户,以查看它是否可以解决您的问题。

503 error is simply shows that your application pool was inaccessible, it was intermittent because your application pool is restarting because the lack of resource (processor, memory, etc). 503错误只是表明您的应用程序池无法访问,它是间歇性的,因为您的应用程序池正在重新启动,因为缺少资源(处理器,内存等)。

Scale up your instance (Cloud Services or VM) to get more resource for the application pool. 扩展您的实例(云服务或VM)以获得更多应用程序池资源。

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

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