What buffer size should I use to maximize disk I/O bandwidth? (16Kb, 32Kb, 64Kb, etc.) [closed]

Posted on

What buffer size should I use to maximize disk I/O bandwidth? (16Kb, 32Kb, 64Kb, etc.) [closed] – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, hard-drive, bandwidth, io, .

I am trying to write a file as fast as I can through a buffered FileChannel similar to a BufferedOutputStream. I am wondering what is the optimum chunk of data I should use per write call to maximize bandwidth? I am on Ubuntu Linux.

Solution :

There is no such thing as a “one size fits all” perfect answer on a question like this.
This sort of thing is impossible to predict.

It depends on the disk, controller, CPU, application, OS, other system load, kernel version, filesystem used and probably about a dozen other things I can’t quickly remember right now.

Often bigger is better, but there usually is a point of diminishing returns.
Trial and error is, for any given system, the only way to say for sure.

Even if you figure this out for your development environment, you will have to do it all again for every other system on which the software needs to run.

Best to do some limited testing and then pick a “reasonable” value that performs “well enough” on the majority of intended target systems.

Leave a Reply

Your email address will not be published.