Optimize buffer size for put_file.