minetest-mapserver / mapserver

Minetest realtime mapserver, written in go
Other
100 stars 22 forks source link

Questions about low spec servers and alternate mapserver setups #299

Open insanity54 opened 1 year ago

insanity54 commented 1 year ago

I have a low-end box (4 core CPU, 2GB RAM) running a Minetest server with Postgres and lots of mods.

I would love to run mapserver but when I had it installed, the game became unplayable due to constant player timeouts. I think the server doesn't have enough RAM. Even without mapserver, my VPS kills minetest-server 1-2 times a week due to being out of memory.

This brings me to my first question. Is it possible to run mapserver in a distributed fashion, running on a different server and remotely connecting to the minetest db for map updates?

Another curiosity I have is that mapserver must live in the minetest world directory. Why does mapserver need to live in the world directory? Why can't I put it in /usr/local/etc/mapserver?

Thank you for your time and your hard work on this project!

BuckarooBanzay commented 1 year ago

I would love to run mapserver but when I had it installed, the game became unplayable due to constant player timeouts. I think the server doesn't have enough RAM. Even without mapserver, my VPS kills minetest-server 1-2 times a week due to being out of memory.

You could try to play with the renderingjobs and renderingfetchlimit values: https://github.com/minetest-mapserver/mapserver/blob/master/doc/config.md#renderingjobs

Also tuning mapblockaccessor.maxitems might help for memory issues (https://github.com/minetest-mapserver/mapserver/blob/master/doc/config.md#mapblockaccessormaxitems) this may cause it to consume more cpu though (reduced cache)

This brings me to my first question. Is it possible to run mapserver in a distributed fashion, running on a different server and remotely connecting to the minetest db for map updates?

The mapserver itself isn't built for a distributed world (yet?). But it should be possible to replicate the map-database to another host and run the mapserver there. Haven't tried it yet but i think litestream would work in case of an sqlite database (https://litestream.io/) and "simple" wal-replication for a postgres db.

Another curiosity I have is that mapserver must live in the minetest world directory. Why does mapserver need to live in the world directory? Why can't I put it in /usr/local/etc/mapserver?

The binary can be anywhere you want, just the current directory has to be the world path: you can cd to your world dir and run the binary with the full path, /usr/local/etc/mapserver in your example.

Thank you for your time and your hard work on this project!

Always happy to help (if i have time:)