summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/autoscale-threads.c
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2018-03-20 17:47:20 +0530
committerMilind Changire <mchangir@redhat.com>2018-03-20 17:47:40 +0530
commit9d482b4e8ddcc17c39ab45ade6afcfd125bda2bb (patch)
treedf55b66c321ce88e55e8957bbce49a54df3d3e04 /rpc/rpc-lib/src/autoscale-threads.c
parent2bb0623cfbeca29264a1b8102c738851fa0d9202 (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. mainline: > Reviewed-on: https://review.gluster.org/19337 > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: Milind Changire <mchangir@redhat.com> (cherry picked from commit 7d641313f46789ec0a7ba0cc04f504724c780855) Change-Id: Ib6838fb8b928e15602a3d36fd66b7ba08999430b BUG: 1550946 Signed-off-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/autoscale-threads.c')
-rw-r--r--rpc/rpc-lib/src/autoscale-threads.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/autoscale-threads.c b/rpc/rpc-lib/src/autoscale-threads.c
index e0e89586160..9e20b37ac63 100644
--- a/rpc/rpc-lib/src/autoscale-threads.c
+++ b/rpc/rpc-lib/src/autoscale-threads.c
@@ -10,13 +10,16 @@
#include "event.h"
#include "rpcsvc.h"
+#include "server.h"
void
-rpcsvc_autoscale_threads (glusterfs_ctx_t *ctx, rpcsvc_t *rpc, int incr)
+rpcsvc_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, thread_count+incr);
+ rpcsvc_ownthread_reconf (conf->rpc, pool->eventthreadcount);
}