Skip to content
Browse files

core: Allow +K and +P arguments to be set and add sane defaults.

Fixes #438
  • Loading branch information...
1 parent 7972139 commit 88ac60ee9456abd60c3c5408ed20e6331e0e9ab7 @arjan arjan committed Oct 29, 2012
Showing with 11 additions and 3 deletions.
  1. +9 −1 src/scripts/helpers/zotonic_setup
  2. +1 −1 src/scripts/zotonic-debug
  3. +1 −1 src/scripts/zotonic-start
View
10 src/scripts/helpers/zotonic_setup
@@ -31,7 +31,15 @@ fi
# if you use comet on popular pages.
# Please check the documentation of your system on how to increase
# the maximum number of open files your operating system.
-export MAX_PORTS=${MAX_PORTS:=1024}
+export MAX_PORTS=${MAX_PORTS:=$(ulimit -n|sed 's/unlimited/100000/')}
+
+# The maximum number of Erlang processes. Must be in the range
+# 16..134217727.
+export MAX_PROCESSES=${MAX_PROCESSES:=10000000}
+
+# Whether or not to use kernel polling (+K argument); either 'true' or
+# 'false'
+export KERNEL_POLL=${KERNEL_POLL:=true}
# The include path for the erlang vm, add when needed for your application.
export PA=${PA:="$ZOTONIC/ebin $ZOTONIC/deps/*/ebin $ZOTONIC/modules/*/deps/*/ebin $ZOTONIC/priv/modules/*/deps/*/ebin $ZOTONIC/priv/sites/*/modules/*/deps/*/ebin"}
View
2 src/scripts/zotonic-debug
@@ -19,4 +19,4 @@
#
cd $ZOTONIC
-$ERL -env ERL_MAX_PORTS $MAX_PORTS +P 10000000 +K true -pa $PA -name $SNAME@$HOSTNAME -boot start_sasl -config $ZOTONIC/priv/erlang.config -sasl errlog_type error -s zotonic
+$ERL -env ERL_MAX_PORTS $MAX_PORTS +P $MAX_PROCESSES +K $KERNEL_POLL -pa $PA -name $SNAME@$HOSTNAME -boot start_sasl -config $ZOTONIC/priv/erlang.config -sasl errlog_type error -s zotonic
View
2 src/scripts/zotonic-start
@@ -61,4 +61,4 @@ ENV=`which env`
HEART_COMMAND="${ENV} HEART=true ZOTONIC_HEART_RESTARTS=$restarts ZOTONIC_HEART_START=$starttime $ZOTONIC_BIN/zotonic start"
export HEART_COMMAND
-$ERL -env ERL_MAX_PORTS $MAX_PORTS -pa $PA -name $SNAME@$HOSTNAME -boot start_sasl -config $ZOTONIC/priv/erlang.config -heart -detached -s zotonic
+$ERL -env ERL_MAX_PORTS $MAX_PORTS +P $MAX_PROCESSES +K $KERNEL_POLL -pa $PA -name $SNAME@$HOSTNAME -boot start_sasl -config $ZOTONIC/priv/erlang.config -heart -detached -s zotonic

0 comments on commit 88ac60e

Please sign in to comment.
Something went wrong with that request. Please try again.