Set the number of processes limit for the erlang runtime? #3911
-
I got inspired by this blog post and wanted to write my own in gleam, I ended up writing this: import gleam/list
import gleam/yielder
import gleam/erlang/process
import gleam/otp/task
const timeout = 600_000
fn work() {
yielder.range(1, 10_000_000)
|> yielder.to_list()
|> list.map(fn(_) { task.async(fn() { process.sleep(10000) }) })
}
pub fn main() {
let w = work()
task.try_await_all(w, timeout)
} And ran it:
Is there a way to increase the process limit? Google seems to suggest settings some "+P" flag. But that's for the erlang runtime? |
Beta Was this translation helpful? Give feedback.
Answered by
lpil
Nov 29, 2024
Replies: 1 comment
-
That's right! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lilja
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's right!
+P
is what you want. You can configure the VM using its environment variables such asERL_FLAGS
. https://www.erlang.org/doc/apps/erts/erl_cmd.html