I want to limit pool size by amount of CPUs. How can I know amount of cores in the CPU for elixir?
You can use System.schedulers_online/0 to get the number of available schedulers. This defaults to the number of cores.
This can be configured on boot with the +S
flag http://erlang.org/doc/man/erl.html#+S
If you really need the number of cores then you can use:
:erlang.system_info(:logical_processors_available)
You can see this option (and many others) on http://www1.erlang.org/doc/man/erlang.html#system_info-1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With