diff options
| author | Krutika Dhananjay <kdhananj@redhat.com> | 2018-01-09 15:11:00 +0530 | 
|---|---|---|
| committer | Raghavendra G <rgowdapp@redhat.com> | 2018-04-02 06:10:30 +0000 | 
| commit | 08fadcc2a706342e4eee79dc7d9b48ba01fcb312 (patch) | |
| tree | 64759c0d2701a80ca0aa5270a44018389306f2bb /glusterfsd/src | |
| parent | 25690197a6af67669346892c36cca471805b9305 (diff) | |
mount/fuse: Add support for multi-threaded fuse readers
Usage: Use 'reader-thread-count=<NUM>' as command line option to
set the thread count at the time of mounting the volume.
Next task is to make these threads auto-scale based on the load,
instead of having the user remount the volume everytime to change
the thread count.
Updates #412
Change-Id: I94aa1505e5ae6a133683d473e0e4e0edd139b76b
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'glusterfsd/src')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 26 | ||||
| -rw-r--r-- | glusterfsd/src/glusterfsd.h | 1 | 
2 files changed, 27 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index a113e3c479f..cb744f04fdf 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -247,6 +247,8 @@ static struct argp_option gf_options[] = {           "option to specify the process type" },          {"event-history", ARGP_FUSE_EVENT_HISTORY_KEY, "BOOL",           OPTION_ARG_OPTIONAL, "disable/enable fuse event-history"}, +        {"reader-thread-count", ARGP_READER_THREAD_COUNT_KEY, "INTEGER", +         OPTION_ARG_OPTIONAL, "set fuse reader thread count"},          {0, 0, 0, 0, "Miscellaneous Options:"},          {0, }  }; @@ -598,6 +600,16 @@ set_fuse_mount_options (glusterfs_ctx_t *ctx, dict_t *options)                          goto err;                  }          } +        if (cmd_args->reader_thread_count) { +                ret = dict_set_uint32 (options, "reader-thread-count", +                                       cmd_args->reader_thread_count); +                if (ret < 0) { +                        gf_msg ("glusterfsd", GF_LOG_ERROR, 0, glusterfsd_msg_4, +                                "failed to set dict value for key " +                                "reader-thread-count"); +                        goto err; +                } +        }          ret = 0;  err: @@ -1340,6 +1352,20 @@ no_oom_api:                  argp_failure (state, -1, 0,                                "unknown event-history setting \"%s\"", arg);                  break; +        case ARGP_READER_THREAD_COUNT_KEY: +                if (gf_string2uint32 (arg, &cmd_args->reader_thread_count)) { +                        argp_failure (state, -1, 0, +                                      "unknown reader thread count option %s", +                                      arg); +                } else if ((cmd_args->reader_thread_count < 1) || +                           (cmd_args->reader_thread_count > 64)) { +                        argp_failure (state, -1, 0, +                                      "Invalid reader thread count %s. " +                                      "Valid range: [\"1, 64\"]", arg); +                } + +                break; +  	}          return 0;  } diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index 4cbad534000..38785441817 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -101,6 +101,7 @@ enum argp_option_keys {          ARGP_PROCESS_NAME_KEY             = 179,          ARGP_FUSE_EVENT_HISTORY_KEY       = 180,          ARGP_THIN_CLIENT_KEY              = 181, +        ARGP_READER_THREAD_COUNT_KEY      = 182,  };  struct _gfd_vol_top_priv {  | 
