VM tuning guide?

I quite often get asked this question and my answer will remain the same. The default settings are good for most applications. There is nothing that you can tune that would make a general application perform better, it all depends on what that application is actually doing.

There is one exception to this rule, and that is the scheduler busy wait time aka +sbtw. For any OS that is using CFS (Completely Fair Scheduler) and when you set CPU limits on Erlang, you want to set all schedulers busy wait to none. That is +sbwt none +sbwtdcpu none +sbwtdio none.

An example of such a system is when you run: docker run -it --cpus 1 erlang

From this example it would seem like what you would like is a guide describing when to use the various options and I think such a guide would be more useful and also easier to write. For example:

Use +sub true when you have given your customer access to per core CPU graphs and they are complaining that the load is not evenly spread across all cores. Or in other words, you should probably never use this option as load compaction is a good thing which saves both energy and allows for better cache locality.

There are so many options in Erlang that it is quite a daunting task to write such a guide, but if someone from the community would like to help out we will do our best to answer any questions that comes up.

A good starting point would probably be what @starbelly suggest, that is, look at what other large open source applications do and ask why they have done that. Maybe you can even get some non-open source application to reveal what they use and why.

13 Likes