Benchmarking Minetest modstorage using PostgreSQL
2023-11-14
Updated: 2023-11-24
A while back, Juri and me Niklp decided to migrate the modstorage SQLite’s of our Minetest servers to Postgresql. The map, player and auth databases of our servers are using already Postgresql. Since some other people reported performance/latency issues with the Postgres backend¹, we decided to do some benchmarks. You can find the source code of the benchmark mod on GitHub. And the results were yes… quite bad.
Chart: Average time it took to handle a MetaDataRef
call in µs (rounded to full µs). You can find the benchmark output at files.niklp.net.
Please note: We had to strip down the two marked pillars to make the SQLite pillars visible. An unedited chart is available too. We know that our benchmark doesn’t measure the data well but we think you should see a difference, especially for storage:set_string()
calls.
We had a talk with some other server owners and admins on Discord and it looks like that most people are aware of this bottleneck but ignore it because the modstorage isn’t used that much on many servers. We will investigate this more when we get some time.
Feel free to share your results in the comment section here or on GitHub with us.
¹: https://github.com/minetest/minetest/issues/12873#issuecomment-1284316336