PleromaisbuiltupontheErlang/OTPVMknownasBEAM.TheBEAMVMishighlyoptimizedforlatency,butthishasdrawbacksinenvironmentswithoutdedicatedhardware.OneofthetricksusedbytheBEAMVMis[busywaiting](https://en.wikipedia.org/wiki/Busy_waiting). This allows the application to pretend to be busy working so the OS kernel does not pause the application process and switch to another process waiting for the CPU to execute its workload. It does this by spinning for a period of time which inflates the apparent CPU usage of the application so it is immediately ready to execute another task. This can be observed with utilities like **top(1)** which will show consistently high CPU usage for the process. Switching between processes is a rather expensive operation and also clears CPU caches further affecting latency and performance. The goal of busy waiting is to avoid this penalty.
MoreadventurousadminscanbecreativewithCPUaffinity(e.g.,*taskset*forLinuxand*cpuset*onFreeBSD)topinprocessestospecificCPUsandeliminatemuchofthiscontention.Themostimportantadviceistorunasfewprocessesaspossibleonyourservertoachievethebestperformance.Evenidlebackgroundprocessescanoccasionallycreate[softwareinterrupts](https://en.wikipedia.org/wiki/Interrupt) and take attention away from the executing process creating latency spikes and invalidation of the CPU caches as they must be cleared when switching between processes for security.
TuningtheBEAMrequiresyouprovideaconfigfilenormallycalled[vm.args](http://erlang.org/doc/man/erl.html#emulator-flags). If you are using systemd to manage the service you can modify the unit file as such: