diff options
author | imil <imil> | 2014-04-25 08:47:51 +0000 |
---|---|---|
committer | imil <imil> | 2014-04-25 08:47:51 +0000 |
commit | 758f87cce98d4114e5f34ced95215d57036f23ce (patch) | |
tree | eaa613c0553eb3676ff948549a3cd5ea6368c732 /databases | |
parent | be3d780e22f42b0fefacc5c00b1a7f1c65e41895 (diff) | |
download | pkgsrc-758f87cce98d4114e5f34ced95215d57036f23ce.tar.gz |
Default fd limit is too low for ElasticSearch, trick taken from mail/dovecot
Diffstat (limited to 'databases')
-rw-r--r-- | databases/elasticsearch/Makefile | 3 | ||||
-rw-r--r-- | databases/elasticsearch/files/elasticsearch.sh | 15 |
2 files changed, 16 insertions, 2 deletions
diff --git a/databases/elasticsearch/Makefile b/databases/elasticsearch/Makefile index 9e544eddbba..28ba5c1a9fd 100644 --- a/databases/elasticsearch/Makefile +++ b/databases/elasticsearch/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2014/04/16 17:22:14 imil Exp $ +# $NetBSD: Makefile,v 1.2 2014/04/25 08:47:51 imil Exp $ DISTNAME= elasticsearch-1.1.0 +PKGREVISION= 1 CATEGORIES= textproc MASTER_SITES= https://download.elasticsearch.org/elasticsearch/elasticsearch/ diff --git a/databases/elasticsearch/files/elasticsearch.sh b/databases/elasticsearch/files/elasticsearch.sh index 8c48d7d1aae..ac87e368afd 100644 --- a/databases/elasticsearch/files/elasticsearch.sh +++ b/databases/elasticsearch/files/elasticsearch.sh @@ -1,6 +1,6 @@ #! @RCD_SCRIPTS_SHELL@ # -# $NetBSD: elasticsearch.sh,v 1.1 2014/04/16 17:22:14 imil Exp $ +# $NetBSD: elasticsearch.sh,v 1.2 2014/04/25 08:47:52 imil Exp $ # # PROVIDE: elasticsearch # REQUIRE: DAEMON @@ -20,6 +20,7 @@ start_precmd="elasticsearch_precmd" : ${elasticsearch_min_mem:="256m"} : ${elasticsearch_max_mem:="1g"} : ${elasticsearch_props:=""} +: ${elasticsearch_fdlimit:="768"} ES_CLASSPATH="@ES_LIBDIR@/@DISTNAME@.jar:@ES_LIBDIR@/*" @@ -43,6 +44,18 @@ command_args=" -Delasticsearch \ org.elasticsearch.bootstrap.Elasticsearch \ >/dev/null &" +# ElasticSearch is fd hungry, default limit leads to write locks +SOFT_FDLIMIT=`ulimit -S -n` +HARD_FDLIMIT=`ulimit -H -n` + +if [ ${elasticsearch_fdlimit} -gt ${SOFT_FDLIMIT} ]; then + if [ ${elasticsearch_fdlimit} -le ${HARD_FDLIMIT} ]; then + ulimit -S -n ${elasticsearch_fdlimit} + else + ulimit -S -n ${HARD_FDLIMIT} + fi +fi + elasticsearch_precmd() { @TOUCH@ ${pidfile} |