Mono 6 safe to use for OpenSim on macOS

Geir Nøklebye

World Builder
Staff member
Having tested mono 6 both for stability and performance well over a week, I have found mono 6 good to go for both building and running OpenSim on macOS.

From the mono 6 Release Notes there are some new functionality for LLVM (which is the compiler used by Apple) that might add better performance, so that has to be looked into. Mono on macOS is largely using LLVM and not the default mono JIT.

For building OpenSim on macOS use msbuild /p:Configuration=Release for best performance unless you specifically want to debug the build.

It is worth noticing that mono 6.0.0.319 is also the version of mono that is installed on your system if you install Microsoft Visual Studio for macOS, meaning you can build and debug OpenSim in VS.

You can also place the following lines in your .profile or .bash_profile to improve mono performance somewhat

export MONO_GC_PARAMS="nursery-size=32m" export MONO_THREADS_PER_CPU=8
 
Have you prescribed yourself?
Mono.org recommends MONO_THREADS_PER_CPU = 2000
Metropolis recommends at least MONO_THREADS_PER_CPU = 300
I recommend MONO_THREADS_PER_CPU = 600-800
 
Last edited by a moderator:
Have you prescribed yourself?
Mono.org recommends MONO_THREADS_PER_CPU = 2000
Metropolis recommends at least MONO_THREADS_PER_CPU = 300
I recommend MONO_THREADS_PER_CPU = 600-800
In practical testing on macOS, my recommendations perform better.

Other settings may work better on different hardware.
I also believe the high settings are more tuned to version 3.x version of mono and when ODE which used a very high number of threads in some situations.

The recommendation of MONO_THREADS_PER_CPU = 2000 only applies to Mono <=2.6.x
 
Last edited:
I'm interested in tuning my vars for OS and wanted to check if your recommendations for the ENV vars still apply for Mono 6.8.x. A couple questions:
- Does the amount of RAM affect the optimal settings? I'm have 16G RAM with about 2.3G reserved for MySQL.
- Is there a way to to check what are all the default MONO_* values currently used for my Opensim, before I make changes?
 
I have not tested on 6.8.x as I get a nasty startup crash, so running on 6.6.0.161.
6.6.0.166 - which is the current Visual Studio channel version, did not behave particularly well with openSim, so reverted even that.

When it comes to the ENV parameters, they should still hold as there is nothing in the 6.8.x release notes that indicates fundamentally changes the environment.

Note that the macOS version of mono don't necessarily respond to ENV tweaking in the same manner as the Linux version because the macOS version primarily use LLVM, and only fall back to the default mono JIT compiler where it is not possible to compile with LLVM (so LLVM+JIT is default on macOS, although you can start mono using JIT only). You can also install LLVM for use by the Linux version, but I doubt very many go to that length.

My recommended settings are derived through lots of testing looking at number of threads in use, simulator startup times and region crossing performance.

Objectively you probably could engage in using profiling for mono and the server application with different settings. Check https://www.mono-project.com/docs/advanced/performance-tips/ for more information on profiling.
 

Members online

No members online now.
Back
Top