2

在我的 Azure Web 角色中,处理大于约 3000 万字节的 POST 请求时出现问题。我知道有 IIS 过滤器可以检测所有大于 3000 万字节的请求并将其结果设置为 404。但我希望这些 404 代码会显示在 IIS 日志中。

我的网络角色的一个用户面临以下行为:对我的网络角色中小于约 3000 万字节的特定 URL 的 POST 请求可以通过(我在 IIS 日志中看到它们)但 POST 请求大于那个(到相同的 URL)为客户端生成 HTTP 503(服务不可用)代码,我在 IIS 日志中看不到这些请求。

这是一个示例长 POST 的标题

POST /mySpecificUrl?paramshere HTTP/1.1
User-Agent: Custom USer Agent
Content-Type: application/octet-stream
Proxy-Authorization: NTLM LongBase64StringHere
Host: my.hostname.here
Content-Length: content length here - about 32 megabytes
Expect: 100-continue

看起来有些东西正在拦截这些请求 - 也许是负载平衡器或其他东西,所以它们没有达到我的角色。

现在用户使用 Fiddler,他声称当他获得代码 503 时,将返回以下内容:

Hello,
A communication error occurred: ""
The Web Server may be down, too busy, or experiencing other
problems preventing it from responding to requests.
You may wish to try again at a later time.

制作为 HTML。此内容附带的标头不包含我们注入到每个响应中的自定义标头,因此这是请求未到达 IIS 的又一证据。

如何找出导致此行为的原因以及如何控制它(例如,更改请求大小阈值)?

4

2 回答 2

1

我完全确定有些东西阻止了到达 IIS 的请求。可能是防火墙规则或负载均衡器,这就是您在 IIS 中看不到日志的原因。坏消息是,我无法找到一种方法来告诉您将发布大量内容。

尝试将此配置应用于“ServiceDefinition.csdef”文件,看看它是否会有所帮助:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
  <LoadBalancerProbes>
    <LoadBalancerProbe protocol="http" name="config" timeoutInSeconds="36000"></LoadBalancerProbe>
  </LoadBalancerProbes>
  <WebRole name="webRoleConfig">
    <Runtime executionContext="elevated"></Runtime>
  </WebRole>  
</ServiceDefinition>
于 2013-08-12T14:22:38.647 回答
0

经过大量努力进行调查并提出支持请求后,得出的结论是,Azure 之外有一些软件会发出该消息,可能是某个代理服务器或其他东西。

我们的服务配置为<system.webServer><security><requestFiltering><requestLimits maxAllowedContentLength 不匹配 <system.web><httpRuntime maxRequestLength>已知这会导致 IIS 返回 HTTP 500 并关闭长度在特定范围内的请求的连接。这只是一个猜测,但也许其他软件会拦截 HTTP 500 响应并发出“Hello”消息。

在 ServerFault 上问了这个问题,以查找已知会发出此消息的软件。

于 2013-09-02T10:48:20.277 回答