asp.net-mvc 哪些可能会导致“服务不可用 503”错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4150952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 00:34:03  来源:igfitidea点击:

What possibilities can cause "Service Unavailable 503" error?

asp.net-mvciiswindows-server-2003http-status-code-503

提问by MemoryLeak

we have a asp.net MVC application deployed to a server, and but when there is too many request to the server, the client will just get a "503 service unavailable" error.
But if I deployed the application to another server ( lower hardware configuration ), everything worked fine, even more requests it can handle well.
My question is what possible configuration can cause the previous server to just throw out a 503 error ? (which means the requests didn't reach our application).

我们有一个 ASP.NET MVC 应用程序部署到服务器,但是当对服务器的请求过多时,客户端只会收到“503 服务不可用”错误。
但是,如果我将应用程序部署到另一台服务器(较低的硬件配置),则一切正常,甚至可以很好地处理更多请求。
我的问题是什么可能的配置会导致以前的服务器抛出 503 错误?(这意味着请求没有到达我们的应用程序)。

回答by Rahul Soni

Your web pages are served by an application pool. If you disable/stop the application pool, and anyone tries to browse the application, you will get a Service Unavailable. It can happen due to multiple reasons...

您的网页由应用程序池提供服务。如果您禁用/停止应用程序池,并且任何人尝试浏览该应用程序,您将获得服务不可用。它可能由于多种原因而发生......

  1. Your application may have crashed [check the event viewer and see if you can find event logs in your Application/System log]

  2. Your application may be crashing very frequently. If an app pool crashes for 5 times in 5 minutes [check your application pool settings for rapid fail], your application pool is disabled by IIS and you will end up getting this message.

  1. 您的应用程序可能已崩溃 [检查事件查看器,看看是否可以在应用程序/系统日志中找到事件日志]

  2. 您的应用程序可能经常崩溃。如果应用程序池在 5 分钟内崩溃 5 次 [检查您的应用程序池设置是否快速失败],则您的应用程序池已被 IIS 禁用,您最终会收到此消息。

In either case, the issue is that your worker process is failing and you should troubleshoot it from crash perspective.

无论哪种情况,问题都在于您的工作进程失败,您应该从崩溃的角度对其进行故障排除。

What is a Crash (technically)... in ASP.NET and what to do if it happens?

什么是崩溃(技术上)...在 ASP.NET 中,如果发生该怎么办?

回答by Yesu Raj

If the server doesn't have enough memory also will cause this problem. This is my personal experience with Godaddy VPS.

如果服务器没有足够的内存也会导致这个问题。这是我个人使用 Godaddy VPS 的经验。

回答by Shiv Kumar

Primarily what that means is that there are too many concurrent requests and further that they exceed the default 1000 queued requests. That is there are 1000 or more queued requests to your website.

这主要意味着并发请求过多,而且超过了默认的 1000 个排队请求。也就是说,您的网站有 1000 个或更多的排队请求。

This could happen (assuming there are no faults in your app) if there are long running tasks and as a result the Request queue is backed up.

如果有长时间运行的任务并因此备份请求队列,则可能会发生这种情况(假设您的应用程序中没有故障)。

Depending on how the application pool has been set up you may see this kind of thing. Typically, the app pool's Process Model has an item called Maximum Worker Processes. By default this is 1. If you set it to more than 1 (typically up to a max of the number of cores on the hardware) you may not see this happen.

根据应用程序池的设置方式,您可能会看到这种情况。通常,应用程序池的进程模型有一项称为最大工作进程数。默认情况下,这是 1。如果您将其设置为 1 以上(通常最多可达硬件上的最大内核数),您可能不会看到这种情况发生。

Just to note that unless the site is extremely busy you should not see this. If you do, it's really pointing to long running tasks

请注意,除非该站点非常繁忙,否则您不应看到此内容。如果你这样做,它真的指向长时间运行的任务

回答by Adnan

We recently encountered this error, root cause turned out to be an expired SSL cert on the IIS server. The Load Balancer (infront of our web tier) found the SSL expired, and instead of handling the HTTP traffic over to one of the IIS servers, started showing this error. So basically IIS unable to server requests, for a totally different reason :)

我们最近遇到了这个错误,根本原因原来是 IIS 服务器上的 SSL 证书过期。负载平衡器(在我们的 Web 层前面)发现 SSL 已过期,而不是将 HTTP 流量处理到其中一台 IIS 服务器,而是开始显示此错误。所以基本上 IIS 无法处理请求,原因完全不同:)