This is not complete guide, so use other guides to configure port forwarding, bash commands, Linux installing etc.
So, my big idea about making fast fast server is to store map file and player files in ram. It increases ram requirement and makes server theoretically less stable, but it is not a big deal if you have much ram and UPS.
I know that minetest can be compiled with different database engine, but i feel it would be harder for me and you need ramdisk for player profiles anyway (at least until developers have fixed intensive read/write to profiles).
I have tested this setup on my "just test" server for two months and it can easily handle 30 players and more.
- You need computer with enough ram - 4GB or more. Also, you better have UPS.
- Install Debian or Ubuntu. Better do not install graphical interface or other modules, except SSH. Better do not install swap partition.
Later you can use Putty and WinSCP to connect to your server. - If you installed Debian stable, add unstable repository to get lates minetest. To file /etc/apt/sources.list add line "deb http://ftp.de.debian.org/debian jessie main"
- Install minetest: Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
apt-get install minetest-server minetest-data
- Define ramfs to store map and folder with user profiles in ram: in file /etc/fstab add lines like these:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
ramfs /home/user/.minetest/worlds/test0/players ramfs noauto,rw,users,sync,size=100M 0 0
ramfs /home/user/.minetest/worlds/test0/map ramfs noauto,rw,users,sync,size=2000M 0 0
- Create folder /home/user/.minetest/worlds/test0/map/
Then in folder /home/user/.minetest/worlds/test0/ create symbolic link with name "map.sqlite" pointing to file /home/user/.minetest/worlds/test0/map/map.sqlite - Make startup script "/etc/init.d/minetest" to run minetest as service, use /etc/init.d/skeleton or https://gist.github.com/MarkTraceur/998260 as base. Use command "/ets/init.d/minetest start" to test it.
- Create folders to safely save map and players, something like:
/home/user/.minetest/worlds/test0/players.safe/ and /home/user/.minetest/worlds/test0/map.safe/ - To keep all in ram, while server is working, and save to disk, when it shuts down, add the following to your startup script:
In "start" part add lines before daemon start:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.- Code: Select all
mount /home/user/.minetest/worlds/test0/players
chown user /home/user/.minetest/worlds/test0/players/
cp -rp /home/user/.minetest/worlds/test0/players.safe/* /home/user/.minetest/worlds/test0/players/
mount /home/user/.minetest/worlds/test0/map
chown user /home/user/.minetest/worlds/test0/map/
cp -rp /home/user/.minetest/worlds/test0/map.safe/map.sqlite /home/user/.minetest/worlds/test0/map/map.sqlite
In "stop" part add lines after daemon stop:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.- Code: Select all
cp -rp /home/user/.minetest/worlds/test0/players/* /home/user/.minetest/worlds/test0/players.safe/
umount /home/user/.minetest/worlds/test0/players
cp -rp /home/user/.minetest/worlds/test0/map/map.sqlite /home/user/.minetest/worlds/test0/map.safe/map.sqlite
umount /home/user/.minetest/worlds/test0/map
- Make minetest to always run and gracefully shutdown, i used chkconfig:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
apt-get install chkconfig
chkconfig --add minetest
- Configure minetest by changing file /home/user/.minetest/minetest.conf
Add something like this:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.- Code: Select all
server_map_save_interval = 500.0
sqlite_synchronous = 0
max_simultaneous_block_sends_server_total = 250
max_simultaneous_block_sends_per_client = 6
max_clearobjects_extra_loaded_blocks = 30000
Also spend some time to configure other options. - On your local computer create new map and copy your map files to server. Copy map.sqlite to map.safe folder.
- Make your server restart regularly, for example every night, so map and players can be saved to disk.
- Restart server and test if game works now.
- Add your mods(to folder /usr/share/games/minetest/games/minetest_game/mods/) and improvements, make good game, which people could play happily for long time :)
Notes:
- I used name "user" for user on my Debian server. For map, i used name "test0", take into account if yours is different.
I heard that maps can easily grow more than 4GB, be aware.
Player profiles could take more than 100MB too.
On Windows you can use ImDisk application to create ramdisks.
Too much bones do heavy load on mobile clients, either disable bones, or remove them regularly with custom mod.
It is possible that map generator take some CPU to generate new bloks, after some time map could load faster and with less CPU usage.
Please, write here if you succeed!
Andrey.