Skip to content

Commit

Permalink
CA-42914, SCTX-434: Speed up writes of the database to the redo-log
Browse files Browse the repository at this point in the history
Anecdotal evidence suggests that the default 1 KiB block size provided by Unixext.read_in_chunks causes write throughput to be very slow on some storage substrates.

Some (not massively scientific) timings of dd from /dev/zero to a block-attached VDI on various SR types agree with this observation. The data below shows that 4 KiB is the minimum block size that should be considered for use: throughput it universally higher above this threshold and often substantially lower below it. We'll default to 16 KiB to be on the safe side.

lvmoiscsi

bs	count	times			throughputs (MB/s)
1024	65536	0m8.461s, 0m7.888s	7.9, 8.5
2048	32768	0m7.986s, 0m8.438s	8.4, 8.0
4096	16384	0m1.529s, 0m1.999s	44.0, 33.6
16384	4096	0m1.289s, 0m1.588s	52.2, 42.3
65536	1024	0m1.550s, 0m1.309s	43.3, 51.3

nfs

bs	count	times			throughputs (MB/s)
1024	65536	0m11.865s, 0m12.232s	5.7, 5.5
2048	32768	0m12.612s, 0m12.758s	5.3, 5.3
4096	16384	2.75591, 3.10301	24.4, 21.6
16384	4096	2.96047, 3.42373	22.7, 19.6
65536	1024	3.23713, 3.24731	20.7, 20.7

lvm

bs	count	times			throughputs (MB/s)
1024	65536	2.16546, 6.35194	31.0, 10.6
2048	32768	6.24928, 6.44344	10.7, 10.4
4096	16384	0.99237, 0.90683	67.6, 74.0
16384	4096	0.912118, 0.88074	73.6, 76.2
65536	1024	0.934838, 0.881285	71.8, 76.1

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
  • Loading branch information
jjd27 committed Oct 28, 2010
1 parent cf1ecbb commit 52af0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocaml/database/block_device_io.ml
Expand Up @@ -324,7 +324,7 @@ let transfer_data_from_sock_to_fd sock dest_fd available_space target_response_t
(* Otherwise write it *)
Unixext.time_limited_write dest_fd len chunk target_response_time;
total_length := !total_length + len
) data_client
) ~block_size:16384 data_client
)
(fun () ->
(* Close the connection *)
Expand Down

0 comments on commit 52af0b7

Please sign in to comment.