Tuning Mono - SignatureBeef/Terraria-s-Dedicated-Server-Mod GitHub Wiki

Configuring for better performance

Choose the garbage collector

We advise the use of the new copying garbage collector instead of Mono's default conservative collector.

To do so run mono-sgen instead of plain mono.

Turn on optimizations

We are pretty confident of Mono's optimizations being stable enough to turn them on. We've used the -O=all,-gshared command line argument on our showcase server without problems.

Switch to LLVM code generation

The LLVM code generator should beat Mono's default one, especially for long running applications like servers.

To turn it on use the --llvm command line argument to mono, however you must have built or otherwise installed Mono with support for it, which is outside the scope of this article.

Furthermore, we can't guarantee its stability. If you experiment with it, let us know.

Configuring for better error diagnostics

Enable debugging information

Adding --debug to Mono's command line will cause errors in the program to generate backtraces with lines numbers, helpful in diagnosing problems. A corresponding .mdb file should be present next to the .exe file for line number information to be output.

Summary

The Mono command line for running TDSM should at least read:

mono-sgen --debug -O=all,-gshared Terraria_Server.exe