Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
file: Return NBD_FLAG_CAN_MULTI_CONN for the file plugin.
This allows multiple connections from a single client, and should be
safe assuming flush/FUA has been implemented correctly in the previous
commit.

Using the file plugin, but locating the file on /dev/shm, I obtained
the following results.

No multi-conn:

   read: IOPS=52.0k, BW=203MiB/s (213MB/s)(23.8GiB/120002msec)
  write: IOPS=52.0k, BW=203MiB/s (213MB/s)(23.8GiB/120002msec)

Multi-conn (-C 8):

   read: IOPS=122k, BW=477MiB/s (500MB/s)(55.9GiB/120002msec)
  write: IOPS=122k, BW=477MiB/s (500MB/s)(55.9GiB/120002msec)
  • Loading branch information
rwmjones committed Jan 5, 2019
1 parent aa46540 commit 910a220
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/file/file.c
Expand Up @@ -250,6 +250,13 @@ file_get_size (void *handle)
}
}

/* Allow multiple parallel connections from a single client. */
static int
file_can_multi_conn (void *handle)
{
return 1;
}

static int
file_can_trim (void *handle)
{
Expand Down Expand Up @@ -507,6 +514,7 @@ static struct nbdkit_plugin plugin = {
.open = file_open,
.close = file_close,
.get_size = file_get_size,
.can_multi_conn = file_can_multi_conn,
.can_trim = file_can_trim,
.can_fua = file_can_fua,
.pread = file_pread,
Expand Down

0 comments on commit 910a220

Please sign in to comment.