我们在生产站点中通过 SSL 上传文件时遇到性能问题。我创建了一个简化的示例来尝试找出问题并发现如果我选择一个 7,599,000 (7.25MB) 字节或更大的文件,则上传该文件需要 2 分钟以上的时间。如果我上传一个 7,598,999 (7.24MB) 字节或更小的文件,上传文件所需的时间会减少 7 秒。出于某种原因,1 个额外的字节使该过程花费了将近 20 倍的时间。
有没有人解释为什么会发生这种情况或有任何解决方案?
这是我正在使用的 ASP.Net 4.5 代码
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload runat="server" ID="FileUpload1" />
<asp:Button runat="server"/>
</div>
</form>
</body>
</html>
网络配置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" executionTimeout="3600" maxRequestLength="1048576" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
我正在测试的服务器是带有 IIS 7.5 的 Server 2008 R2
最佳答案
我一直无法在 Windows Server 2008 上解决这个问题,所以我尝试创建一个新的 2012 R2 实例并且效果很好。它一定是我的一些配置设置。
关于asp.net - 使用 ASP.Net 和 IIS 通过 SSL 上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23569082/