【问题标题】:Scalabilty issues with Restful WCFRestful WCF 的可扩展性问题
【发布时间】:2012-06-26 15:37:57
【问题描述】:

您好,我已经构建了一个简单的 WCF 应用程序,用于从移动应用程序来回查询数据。 其他一切工作正常但是当我尝试上传大型二进制视频上传时,它给了我奇怪的错误,我成功地能够上传高达 3-4 MB 但大于那个的二进制流 我随机收到以下错误之一

1.

<html>

   <BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: ""
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
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.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY>
</html>

2.

<html>

<body>

<div id="header"><h1>Server Error</h1></div>

<div id="content">

 <div class="content-container"><fieldset>

  <h2>404 - File or directory not found.</h2>

  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>

 </fieldset></div>

</div>

</body>

</html>

这是我的 Web.Config

<?xml version="1.0"?>
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483648" />
      </requestFiltering>
    </security>
  </system.webServer>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
   <bindings>
      <webHttpBinding>
        <binding transferMode="Streamed" maxBufferSize="5242880" maxReceivedMessageSize="2147483647" openTimeout="05:25:00" closeTimeout="00:25:00" sendTimeout="00:25:00" receiveTimeout="0:25:00"
                 name="webBinding"
        />
      </webHttpBinding>
    </bindings>
    <services>
       <service behaviorConfiguration="RestBehavior" name="EyePlots.Videos">
        <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webBinding"
           contract="EyePlots.IVideos" />
      </service>
</services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="RestBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="100"
    maxConcurrentInstances="100" maxConcurrentSessions="100" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

这可能是系统的可扩展性问题吗?如果你们愿意,我可以发布我的代码 sn-ps 吗?谢谢!

【问题讨论】:

    标签: wcf sql-server-2008 iis-7 wcf-data-services


    【解决方案1】:

    我认为 4 兆是 IIS 限制。

    你设置了吗(IIS7+)

    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="2147483648" />
        </requestFiltering>
      </security>
    </system.webServer>
    

    这是一篇文章,列出了更多尝试打开的节流阀。 WCF problem with uploading large file, hosted in IIS

    【讨论】:

    • 如果这不是您的问题,请发布您的配置。
    • 添加一个链接,列出更多限制,允许回答者上传大文件。
    • 感谢添加&lt;system.web&gt; &lt;httpRuntime executionTimeout="4800" maxRequestLength="500000000"/&gt; &lt;/system.web&gt; 解决了这个问题!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-19
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    • 2011-06-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多