ASP.NET 中分块传输的最佳响应大小是多少?
我正在创建一个反向代理,并试图为分块传输编码的响应大小找到最佳缓冲区。 目前我将其设置为 4 kb。 这个数字可以吗?或者我应该使用更好的尺寸。 如果可能的话,我希望通过一些测试来支持这一点。
我还接受 .NET 框架中有人知道的具有默认值的属性设置。
I am creating a reverse proxy and I am trying to find the optimal buffer for a response size for a chunked transfer-encoding. Currently I have it set at 4 kb. Is this number OK, or is there a better size that I should be using. I would like this backed up with some tests if at all possible.
I would also accept a property setting somebody knows about in the .NET framework that has a default value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最佳大小将取决于应用程序和网络。 有一篇上一篇文章提供了有关衡量最佳效果的建议给定环境的块大小。
J2ME 过去默认使用 2KB 块(即客户端到服务器)。 但我不知道 .NET 默认是什么。 不幸的是,关于分块的 HTTP 规范也没有提供任何指导。
The optimal size is going to be rather application and network specific. There was a previous post that offered suggestions on measuring the best chunk size given the environment.
J2ME used to default to 2KB chunks (that's client-to-server). But I have no idea what .NET defaults to. Unfortunately the HTTP Spec on chunking offers no guidance either.
我的大文件传输导致 Web 服务器崩溃,因此我根据本文实现了分块:http://support .microsoft.com/kb/812406
客户立即抱怨文件下载时间延长了 3 倍,缓冲区设置为 10K。 在某些情况下,这些文件的大小为 80-100MB。 我将缓冲区提高到 200K,并将发布我的结果。
I had large file transfers that were killing the web server so I implemented chunking per this article: http://support.microsoft.com/kb/812406
Customers immediately complained that file downloads took 3 times as long, the buffer was set to 10K. In some cases these files are 80-100MB in size. I upped the buffer to 200K and will post my results.