Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Startup script set max ports to 1024 #438

mworrell opened this Issue · 2 comments

3 participants


The script should set the max ports to the ulimit -n

Script: src/scripts/helpers/zotonic_setup

# Increase this if you expect a lot of concurrent connections. For example
# 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}

While we are at it, also the number of processes should be increased.

In debug we use +P 10000000
In production this parameter is missing (as is +K).


+1 for a ulimit -n default. (Btw it can be unlimited)

In production I have set the ulimit for zotonic very high and use MAX_PORTS to limit it, but it is always possible to override. This allows me to increase the number quickly without going through a reboot of the whole server first.

Btw, I've also hit the maximum number of ets tables limit. This is really not fun because it crashes the whole VM.

It is a bit tricky to pass environment variables to the erl vm because of the way the start scripts work.

Maybe it is an idea to investigate whether is a better option to start zotonic. The current setup has some problems when things spin out of control. On a heavy loaded machine for instance it can be very hard to kill zotonic because heart keeps restarting it and heart keeps restarting zotonic.

@arjan arjan closed this in 88ac60e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.