Skip to content

Commit

Permalink
engines/ceph: add option for setting config file path
Browse files Browse the repository at this point in the history
Specifies the configuration path of ceph cluster on rados test, so
conf file does not have to be /etc/ceph/ceph.conf.
To set the option, adding the next line to global section of fio:
conf=path_to_ceph_config_file

Signed-off-by: Mingyuan Liang <[email protected]>
  • Loading branch information
liangmingyuanneo committed May 29, 2022
1 parent a284033 commit 873db85
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HOWTO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,11 @@ with the caveat that when used on the command line, they must come after the
the full *type.id* string. If no type. prefix is given, fio will add
'client.' by default.

.. option:: conf=str : [rados]

Specifies the configuration path of ceph cluster, so conf file does not
have to be /etc/ceph/ceph.conf.

.. option:: busy_poll=bool : [rbd,rados]

Poll store instead of waiting for completion. Usually this provides better
Expand Down
13 changes: 12 additions & 1 deletion engines/rados.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct rados_options {
char *cluster_name;
char *pool_name;
char *client_name;
char *conf;
int busy_poll;
int touch_objects;
};
Expand Down Expand Up @@ -69,6 +70,16 @@ static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_RBD,
},
{
.name = "conf",
.lname = "ceph configuration file path",
.type = FIO_OPT_STR_STORE,
.help = "Path of the ceph configuration file",
.off1 = offsetof(struct rados_options, conf),
.def = "/etc/ceph/ceph.conf",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_RBD,
},
{
.name = "busy_poll",
.lname = "busy poll mode",
Expand Down Expand Up @@ -184,7 +195,7 @@ static int _fio_rados_connect(struct thread_data *td)
goto failed_early;
}

r = rados_conf_read_file(rados->cluster, NULL);
r = rados_conf_read_file(rados->cluster, o->conf);
if (r < 0) {
log_err("rados_conf_read_file failed.\n");
goto failed_early;
Expand Down
1 change: 1 addition & 0 deletions examples/rados.fio
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
ioengine=rados
clientname=admin
pool=rados
conf=/etc/ceph/ceph.conf
busy_poll=0
rw=randwrite
bs=4k
Expand Down
4 changes: 4 additions & 0 deletions fio.1
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,10 @@ Ceph cluster. If the \fBclustername\fR is specified, the \fBclientname\fR shall
the full *type.id* string. If no type. prefix is given, fio will add 'client.'
by default.
.TP
.BI (rados)conf \fR=\fPstr
Specifies the configuration path of ceph cluster, so conf file does not
have to be /etc/ceph/ceph.conf.
.TP
.BI (rbd,rados)busy_poll \fR=\fPbool
Poll store instead of waiting for completion. Usually this provides better
throughput at cost of higher(up to 100%) CPU utilization.
Expand Down

0 comments on commit 873db85

Please sign in to comment.