summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2015-04-06 17:30:02 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-04-28 21:31:43 -0700
commit2bde49f98964724b9e12255539bd1a91b3c8b086 (patch)
tree42b7b4a8c30b24a9fd8c236ea153a89da9021660 /xlators
parent32c35e175ac362a9682b10600044a5fe17441176 (diff)
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: 1212385 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/10269 Tested-by: NetBSD Build System Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/nfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 719682b236a..be84a1b649e 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"
@@ -1052,6 +1053,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);