summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-07-11 09:21:27 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-08-10 00:05:30 -0700
commit426d28fbd85486d35dc52b0789d94f4e76d03e66 (patch)
treeaa3c8695460ec4f49c8281433da0846cc42973f6 /xlators/mgmt/glusterd/src/glusterd.c
parent0e0c3ec84c73bc5fcda16ed743f9d3dc0a582c03 (diff)
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 <NUM-OF-EPOLL_WORKERS> BUG: 1250809 Change-Id: I2a9e2d81c64beaf54872081f9ce45355cf4dfca7 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11630 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> (cherry picked from commit 6b7bdcb02cf39199d3720c2471121d14df64c8ab) Reviewed-on: http://review.gluster.org/11847
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 2c755457715..b83b249a404 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -28,6 +28,7 @@
#include "defaults.h"
#include "list.h"
#include "dict.h"
+#include "options.h"
#include "compat.h"
#include "compat-errno.h"
#include "syscall.h"
@@ -1327,6 +1328,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
{
@@ -1775,6 +1777,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) {
@@ -1953,5 +1964,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} },
};