From 60f33e6d12a854c425c2bbe237e0902a8e433631 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: 1136352 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 --- xlators/mgmt/glusterd/src/glusterd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index b59353566a7..ab7ab3a2171 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1161,6 +1161,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