views:

3000

answers:

5

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.

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

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.

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.

A: 

5 Mb seems like a lot of data to transfer over a Web Service. The first thing you should look for is to send less data. Secondly you need to set the size to your needs.

khebbie
Remember that WCF can be used for more than simple web services.
chilltemp
A: 

If you're trying to transfer files and such, this seems like your only option. Otherwise I'd review why such large pieces of data are being sent across the service in the first place. If it is files and such, you'll just have to live with that large size and the possible repercussions. You also, again if it is files you're moving, might want to try an FTP component or something instead.

I could provide more information with a little elaboration. I'll check back later to see if you've added anything to your question.

Adron
+1  A: 

Hi,

It is perfectly OK to transfer large amounts of data to a WCF-based service, but you should look into a binding that supports streaming instead of buffered transfers (BasicHttpBinding or a CustomBinding) so each service instance doesn't hog too much memory.

--larsw

larsw
+3  A: 

Check out this article. http://kennyw.com/indigo/51

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

Doanair
Thanks for answering this old question, that's the sort of information that could help.
alextansc
A: 

just created a video and uploaded for the easy kindly download the same and you will get the idea regarding the buffer size, or maximassagesize issue, or maxarraylength etc.

http://dc153.4shared.com/download/104448179/ab2b182d/wcfandlargedata.mp4

for further videos --

http://www.elearningfromhome.com/Sample_Videos.html

Hi, maruti, I appreciated the links, but you should update it again. Current working link: http://www.elearningfromhome.com/Sample_Videos.php
alextansc