nhpip

nhpip

Is anyone aware of a guide that describes the optimal, or even just recommended, VM configuration options for specific deployments?

Scheduler, inet, memory etc. for cloud, containerized, bare metal, embedded etc

Showing Posts 1 to 10

scottmessinger

scottmessinger

We had massive issues running Elixir in a container until we tweaked the vm settings. This is in our vm.args.eex

## Enable kernel poll
+K true

## Aysnc threads
+A 128

## Increase number of concurrent ports/sockets
## Same as setting: -env ERL_MAX_PORTS 65536
+Q 65536

## Something about scheduling
## https://stressgrid.com/blog/beam_cpu_usage/
+sbwt none
+sbwtdcpu none
+sbwtdio none
25
Post #1
dimitarvp

dimitarvp

Thanks for this! Bookmarking it.

mattbaker

mattbaker

We’ve had an easy time running in containers but I want to call out the sbwt options in particular, they significantly dropped our CPU usage (at least as CFS was measuring it)

I’m so curious about these other options @scottmessinger, if you ever write something up about what led you to them I’d love to read it :heart_eyes:

mattbaker

mattbaker

It looks like +K was removed into OTP 21 and +A may have less impact now with the introduction of the dirty scheduler. +Q appears to default to 65536 so maybe that’s not needed anymore?

scottmessinger

scottmessinger

We were seeing our Elixir/Phoenix servers crash after ~1000 simultaneous connections.
Also, we had to change the tcp_keepalive_time and file-max

sysctl -w net.ipv4.tcp_keepalive_time=250 fs.file-max=1024000

It looks like +K was removed into OTP 21 and +A may have less impact now with the introduction of the dirty scheduler. +Q appears to default to 65536 so maybe that’s not needed anymore?

It would be wonderful if the vm settings I used weren’t needed anymore – it was miserable and confusing. Also, there was very little written about it, so there was a bunch of guessing and hoping on my part.

+sbwt none
+sbwtdcpu none
+sbwtdio none

I think the import parts were these one above. Do you know much about those settings, @mattbaker? I’d love to know what I was changing – at the time, it felt like reciting a magical incantation.

nhpip

nhpip OP

These are the options I’m using as of last night;

   +c true 
   +C multi_time_warp
   +sub true
   +swt very_low
   +swtdio very_low
   +sbwt none
   +sbwtdcpu none
   +sbwtdio none
dimitarvp

dimitarvp

Is this exclusively for containers? Or universally?

AstonJ

AstonJ

For anyone coming to this thread in future here’s some of what @garazdawi said in the thread on EFS:

See his full response and the rest of the thread here:

11
Post #8
nhpip

nhpip OP

It’s the VM putting a scheduler in busy wait so the cpu core doesn’t go to sleep. The problem in containerized environments, like AWS, is that it can eat into your cpu quotas.

donghyun

donghyun

In my experience, I believe the BEAM was not quite optimized for containerized environments before OTP 23. For example, scheduler counts did not match the CPU cores in our k8s manifests. My team found the Rabbit MQ Runtime Tuning, which has helped us a lot. After OTP 23 was out, we noticed that we didn’t need most of the tunings anymore so we removed it.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews