From 42c51dcdf3e99d955b98bab53afee0a3c9a2a7df Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 6 Apr 2015 17:30:02 +0530 Subject: nfs: Enable throttling for rpcsvc Busy nfs servers need throttling to prevent duplicate requests from casuing an increase in memory consumption. Change-Id: I855bb1e841ba06b523e55f86f7788a0f7a49d444 BUG: 1216310 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.org/10269 Reviewed-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Raghavendra G Tested-by: Raghavendra G Reviewed-on: http://review.gluster.org/10444 Tested-by: NetBSD Build System --- xlators/nfs/server/src/nfs.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xlators') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 965aec7daa9..2ab8e5b983a 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -36,6 +36,7 @@ #include "acl3.h" #include "rpc-drc.h" #include "syscall.h" +#include "rpcsvc.h" #define OPT_SERVER_AUX_GIDS "nfs.server-aux-gids" #define OPT_SERVER_GID_CACHE_TIMEOUT "nfs.server.aux-gid-timeout" @@ -1046,6 +1047,12 @@ nfs_init_state (xlator_t *this) goto free_foppool; } + ret = rpcsvc_set_throttle_on (nfs->rpcsvc); + if (ret) { + gf_log (GF_NFS, GF_LOG_ERROR, "Enabling throttle failed"); + goto free_foppool; + } + ret = rpcsvc_set_outstanding_rpc_limit (nfs->rpcsvc, this->options, RPCSVC_DEF_NFS_OUTSTANDING_RPC_LIMIT); -- cgit