4096 is pretty small as buffers go, but it's a decent size and it matches up 
well with some OS and filesystem structures.

Larger buffers will only help if your documents tend to be larger than 4-kiB, 
and if nothing else gets in the way. For maximum effect you'll also want to 
tune the client OS TCP/IP receive buffer size and the server OS TCP/IP send 
buffer size to match. If you want to experiment, I wouldn't go higher than 
256-kiB. Remember that whatever size you set will be multiplied by concurrency, 
and could hurt performance if it puts the VM under memory pressure.

-- Mike

> On 5 Dec 2014, at 07:53 , [email protected] wrote:
> 
> Hi,
>  
> We use the java client (xcc) and stream out large files. I was wondering if 
> there is certain buffer size we should be using for optimal performance, or 
> does it even matter? Currently we take the stream straight out of ResultItem 
> and use org.apache.commons.io.IOUtils.copy(InputStream, OutputStream) to do 
> the heavy lifting. It seems that it uses DEFAULT_BUFFER_SIZE = 1024 * 4.
>  
> Do you have any suggestions or insight to this matter?
>  
> Ville
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to