optimal block sizes

1 view
Skip to first unread message

Erik Engbrecht

unread,
Jun 12, 2008, 11:09:14 PM6/12/08
to wide-...@googlegroups.com
Because I'm lazy and haven't yet experimented with different block sizes, has anyone else done so?  What does the optimal block size seem to be?

Last time I profiled on my MacBook it seemed to be 32k, but my MacBook obviously isn't the T2.

Tim Bray

unread,
Jun 12, 2008, 11:29:47 PM6/12/08
to wide-...@googlegroups.com
You could grab the Bonnie source code and fool with the disk sizes.
Last time I did that, on some ridiculously high-performance monster
server, I found remarkably little gain from changing it around, so it
stays at 8k or 16k or some such. -T

Preston L. Bannister

unread,
Jun 12, 2008, 11:43:53 PM6/12/08
to wide-finder
I generally use 50K or a bit more for read() sizes - safely above the
knee of the curve (around ~30KB in my past testing). The amount of
memory is so tiny (on today's machines), and future hardware/software
may be different.


On Jun 12, 8:29 pm, "Tim Bray" <timb...@gmail.com> wrote:
> You could grab the Bonnie source code and fool with the disk sizes.
> Last time I did that, on some ridiculously high-performance monster
> server, I found remarkably little gain from changing it around, so it
> stays at 8k or 16k or some such. -T
>
> On Thu, Jun 12, 2008 at 8:09 PM, Erik Engbrecht
>

Erik Engbrecht

unread,
Jun 12, 2008, 11:47:09 PM6/12/08
to wide-...@googlegroups.com
It's more than just the IO.  In my particular case a larger block size means less messaging between worker threads, which means less synchronization and a little less work reconstructing lines that are split across blocks.  But it also means one thread is spending more time hogging the input channel...which may or may not be bad.  It depends on if the blocks take a consistent amount of time to process or not.  If they vary by much, starvation could occur.  If not, then other than loosing a few cycles as things get started, it's no big deal.
Reply all
Reply to author
Forward
0 new messages