Skip to content

Commit

Permalink
Increase default disk cache to 16 MiB
Browse files Browse the repository at this point in the history
  • Loading branch information
amadvance committed Jan 9, 2022
1 parent 02d170c commit eb19c79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SnapRAID HISTORY
12.1 2022/01
============
* Reduce stack usage to work in enviromnents with limited stack size, like MUSL.
* Increase the default disk cache from 8 MiB to 16 MiB.

12.0 2021/12
============
Expand Down
4 changes: 2 additions & 2 deletions cmdline/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,9 @@ void io_init(struct snapraid_io* io, struct snapraid_state* state,

#if HAVE_THREAD
if (io_cache == 0) {
/* default is 8 MiB of cache */
/* default is 16 MiB of cache */
/* this seems to be a good tradeoff between speed and memory usage */
io->io_max = 8 * 1024 * 1024 / state->block_size;
io->io_max = 16 * 1024 * 1024 / state->block_size;
if (io->io_max < IO_MIN)
io->io_max = IO_MIN;
if (io->io_max > IO_MAX)
Expand Down
4 changes: 2 additions & 2 deletions cmdline/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* 4 - 452 MB/s, CPU 54%, speed 118%
* 8 - 487 MB/s, CPU 60%, speed 128%
* 16 - 505 MB/s, CPU 63%, speed 132%
* 32 - 520 MB/s, CPU 64%, speed 136%
* 64 - 524 MB/s, CPU 65%, speed 137%
* 32 - 520 MB/s, CPU 64%, speed 136% [SnapRAID <= 12.0]
* 64 - 524 MB/s, CPU 65%, speed 137% [SnapRAID > 12.0]
* 128 - 525 MB/s, CPU 66%, speed 138%
*/
#define IO_MIN 3 /* required by writers, readers can work also with 2 */
Expand Down

0 comments on commit eb19c79

Please sign in to comment.