From 6b7bdcb02cf39199d3720c2471121d14df64c8ab Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Sat, 11 Jul 2015 09:21:27 +0530 Subject: glusterd: use 2 epoll worker threads by default The no. of epoll worker threads can be configured by adding the following option into glusterd.vol. option event-threads BUG: 1242421 Change-Id: I2a9e2d81c64beaf54872081f9ce45355cf4dfca7 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/11630 Tested-by: NetBSD Build System Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd.c | 21 +++++++++++++++++++++ xlators/mgmt/glusterd/src/glusterd.h | 1 + 2 files changed, 22 insertions(+) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 9a8759f2fc3..3cac55b91bd 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -24,6 +24,7 @@ #include "defaults.h" #include "list.h" #include "dict.h" +#include "options.h" #include "compat.h" #include "compat-errno.h" #include "syscall.h" @@ -1353,6 +1354,7 @@ init (xlator_t *this) char *valgrind_str = NULL; char *transport_type = NULL; char var_run_dir[PATH_MAX] = {0,}; + int32_t workers = 0; #ifndef GF_DARWIN_HOST_OS { @@ -1804,6 +1806,15 @@ init (xlator_t *this) if (ret) goto out; + GF_OPTION_INIT ("event-threads", workers, int32, out); + if (workers > 0 && workers != conf->workers) { + conf->workers = workers; + ret = event_reconfigure_threads (this->ctx->event_pool, + workers); + if (ret) + goto out; + } + ret = 0; out: if (ret < 0) { @@ -1982,5 +1993,15 @@ struct volume_options options[] = { .max = 300, .default_value = TOSTRING(RPC_DEFAULT_PING_TIMEOUT), }, + { .key = {"event-threads"}, + .type = GF_OPTION_TYPE_INT, + .min = 1, + .max = 32, + .default_value = "2", + .description = "Specifies the number of event threads to execute " + "in parallel. Larger values would help process" + " responses faster, depending on available processing" + " power. Range 1-32 threads." + }, { .key = {NULL} }, }; diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index ec7c79c7c55..29dd299c324 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -170,6 +170,7 @@ typedef struct { struct cds_list_head missed_snaps_list; int ping_timeout; uint32_t generation; + int32_t workers; } glusterd_conf_t; -- cgit