From 07235e99003693687e349f74d5627bd8c53ff1e0 Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Tue, 2 Sep 2014 17:43:43 +0530 Subject: glusterd: Set the rlimit for Open FDs to higher value. Default 'open FD limit' is 1024. As the number of volumes/bricks increases, brick-to-glusterd socket FDs also increases in glusterd and runs out of the limit. Solution is to set the 'Open FD' limit to higher value in glusterd Change-Id: Iaa60b2155df2fa5a0759e054bdebffbc09f63ec1 BUG: 1145095 Signed-off-by: Vijaikumar M Reviewed-on: http://review.gluster.org/8578 Reviewed-by: Rajesh Joseph Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/8807 --- xlators/mgmt/glusterd/src/glusterd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index f4ead6115e3..b9a43cd32ce 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1198,6 +1198,24 @@ init (xlator_t *this) int i = 0; char *valgrind_str = NULL; +#ifndef GF_DARWIN_HOST_OS + { + struct rlimit lim; + lim.rlim_cur = 65536; + lim.rlim_max = 65536; + + if (setrlimit (RLIMIT_NOFILE, &lim) == -1) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to set 'ulimit -n " + " 65536': %s", strerror(errno)); + } else { + gf_log (this->name, GF_LOG_INFO, + "Maximum allowed open file descriptors " + "set to 65536"); + } + } +#endif + dir_data = dict_get (this->options, "working-directory"); if (!dir_data) { -- cgit