在 WCF 中,您是否应该为大消息设置较大的 MaxBufferPoolSize 值? [英] In WCF, should you have large MaxBufferPoolSize value for large messages?

查看:52
本文介绍了在 WCF 中,您是否应该为大消息设置较大的 MaxBufferPoolSize 值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我开发的这个 WCF 服务,我必须将 MaxReceivedMessageSize 设置为 5MB.我目前的问题是弄清楚是使用更大的 MaxBufferPoolSize 值(如 5MB)还是保留原始 512KB 值更好.

For this WCF service I have developed, I have to set MaxReceivedMessageSize to 5MB. My current problem is figuring out whether it is better to have a larger MaxBufferPoolSize value, like 5MB, or retain the original 512KB value.

有谁知道这个场景的推荐设置是什么?
简而言之,我应该设置 MaxBufferPoolSize = 5242880 (5MB) 还是 MaxBufferPoolSize = 524288 (512KB)?

Does anyone knows what is the recommended setting for this scenario?
In short, should I set MaxBufferPoolSize = 5242880 (5MB), or MaxBufferPoolSize = 524288 (512KB)?

更新:为了澄清起见,该服务旨在插入新的客户记录以及一些扫描的文档.因此,消息大小可能会达到 5MB.

UPDATE: For clarification, the service is meant to insert a new customer record along with some scanned documents. As a result, the message size may reached up to 5MB.

我们可以尝试使用替代技术将扫描文档的上传分开,但要求客户记录和扫描文档必须在同一个事务中,因此我们决定采用这种方法,直到我们弄清楚如何使用 WCF 的事务功能.

We could try and separate the upload of the scanned document using alternate technologies, but the requirement was both customer record and scanned documents must be in the same transaction, so we decided to go with this approach, until we figure out how to use WCF's transaction capability.

推荐答案

查看这篇文章.http://kennyw.com/?p=51

建议将大消息的 MaxBufferPoolSize 设置为零以避免缓冲.

It suggests setting the MaxBufferPoolSize to zero for large messages in order to avoid buffering.

这篇关于在 WCF 中,您是否应该为大消息设置较大的 MaxBufferPoolSize 值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆