Originally posted by Costa Lamona:
if you have a server of 4 GB of ram, there is uploading messages will reach 250 MB(s), what buffer size you choose ? Do you think that a buffer of 256 MB(s) is a good choice?
You don't need the buffer to be the size of the message, else don't bother buffering. What if 20 or 200 clients upload messages at once, is that possible in your application?
You could have an 8kb buffer and read and write quite quickly, but this is for you to understand your application usage and fiddle with and
test your results as close to production load as is reasonably possible.