diff options
author | Milind Changire <mchangir@redhat.com> | 2018-02-26 15:14:18 +0530 |
---|---|---|
committer | Milind Changire <mchangir@redhat.com> | 2018-02-26 15:14:38 +0530 |
commit | 7d641313f46789ec0a7ba0cc04f504724c780855 (patch) | |
tree | 6111a02fd1e338de69bae6acdea833c946b1fb94 /glusterfsd/src/glusterfsd-mgmt.c | |
parent | a1e59bc8fd220b4cba038e2db2630665ba871b50 (diff) |
rpcsvc: scale rpcsvc_request_handler threads
Scale rpcsvc_request_handler threads to match the scaling of event
handler threads.
Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1467614#c51
for a discussion about why we need multi-threaded rpcsvc request
handlers.
Change-Id: Ib6838fb8b928e15602a3d36fd66b7ba08999430b
Signed-off-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 355b25f8aab..fa824de9996 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -33,6 +33,7 @@ #include "xlator.h" #include "syscall.h" #include "monitoring.h" +#include "server.h" static gf_boolean_t is_mgmt_rpc_reconnect = _gf_false; int need_emancipate = 0; @@ -185,12 +186,15 @@ glusterfs_terminate_response_send (rpcsvc_request_t *req, int op_ret) } void -glusterfs_autoscale_threads (glusterfs_ctx_t *ctx, int incr) +glusterfs_autoscale_threads (glusterfs_ctx_t *ctx, int incr, xlator_t *this) { struct event_pool *pool = ctx->event_pool; + server_conf_t *conf = this->private; + int thread_count = pool->eventthreadcount; pool->auto_thread_count += incr; - (void) event_reconfigure_threads (pool, pool->eventthreadcount+incr); + (void) event_reconfigure_threads (pool, thread_count+incr); + rpcsvc_ownthread_reconf (conf->rpc, pool->eventthreadcount); } int @@ -842,6 +846,7 @@ glusterfs_handle_attach (rpcsvc_request_t *req) xlator_t *nextchild = NULL; glusterfs_graph_t *newgraph = NULL; glusterfs_ctx_t *ctx = NULL; + xlator_t *protocol_server = NULL; GF_ASSERT (req); this = THIS; @@ -879,7 +884,12 @@ glusterfs_handle_attach (rpcsvc_request_t *req) nextchild->name); goto out; } - glusterfs_autoscale_threads (this->ctx, 1); + /* we need a protocol/server xlator as + * nextchild + */ + protocol_server = this->ctx->active->first; + glusterfs_autoscale_threads (this->ctx, 1, + protocol_server); } } else { gf_log (this->name, GF_LOG_WARNING, |