Last active
July 4, 2026 03:05
-
-
Save up1/961d8856a6bf56d6508067188cd7793a to your computer and use it in GitHub Desktop.
ULimit BEAM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Check in OS limit | |
| ulimit -n | |
| # 2. Check on system (ulimit -n cannot exceed) | |
| cat /proc/sys/fs/file-max | |
| # 3. check in BEAM | |
| :erlang.system_info(:port_limit) # the +Q ceiling | |
| :erlang.system_info(:port_count) # current usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in $(seq 1 2000); do | |
| nc localhost 4001 >/dev/null & | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| beam-limit-lab: | |
| build: . | |
| ports: | |
| - "4000:4000" | |
| environment: | |
| # Good production-style setting | |
| ERL_AFLAGS: "+Q 65536" | |
| ulimits: | |
| nofile: | |
| soft: 65536 | |
| hard: 65536 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit | |
| ACCEPT ERROR: :system_limit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment