1

我有一个托管在 IIS 8.5 Windows 2012 R2 机器上的 WCF (.net 4.5.2) 应用程序,它调用托管在另一台 IIS 8.5 Windows 2012 R2 机器上的另一个 WCF(.net 4.5.2) 应用程序。问题是我们有批量呼叫(比如说 200+)我的请求似乎正在排队。知道我做了什么特别的改进吗?两台机器都有 4 核和 4 GB 内存

编辑目前我已经尝试在机器配置中进行以下调整

<!-- <processModel autoConfig="true" /> -->
    <processModel autoConfig="false" maxWorkerThreads="1400" maxIoThreads="1400" minWorkerThreads="10" />

我还随机看到的一个问题是我收到 500 个内部错误。看起来呼叫永远不会到达第二台服务器。完整的错误跟踪是

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 192 bytes of the response were: '<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
'.
System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 192 bytes of the response were: '<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
'. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   --- End of inner exception stack trace ---
4

1 回答 1

0

log4net 数据库日志记录被发现是罪魁祸首。DB日志记录一一发生,因此我将log4net的bufferSize属性增加到10。如果有更好的改进建议,请告诉我。

于 2015-11-20T10:36:51.107 回答