Page 1 of 1

Minetest on Ubuntu as service (with RAMDISK and backups)

PostPosted: Tue Jun 24, 2014 14:27
by lag01
2018
Rewritten in systemd.
Now uses only single ramdisk for entire world folder.
No need to custom minetest compilation.
Little simplified installation.

https://github.com/AndrejIT/RAMDISK_setup

Here is old obsolete guide:
+ Spoiler

Re: Guide to create fast minetest server on Linux

PostPosted: Sat Jul 05, 2014 18:21
by Calinou
Code: Select all
active_block_range = 1
max_block_generate_distance = 6
max_block_send_distance = 6


Saves quite a lot of bandwidth of CPU, for almost no downsides (few people use a high enough viewing range to enjoy high distance block sends anyway).

The first line helps a lot when using mobs or mods that heavily rely on entities and ABMs.

Re: Guide to create fast minetest server on Linux

PostPosted: Wed Nov 05, 2014 13:44
by twoelk
Calinou wrote:... (few people use a high enough viewing range to enjoy high distance block sends anyway).
....

I for one love to climb to some high place after a long journey and then switching on far view look back at the path I have taken. I have loads of screenshots of such views. I have experimented with how far "far view" actually is on VanessaE's creative server. Turned out at the time to be limited to something like 3500 nodes. At least that was how far away you could be from MichaelEh's space station and still see it. The pictures I made of Mt.Meru on Brandon's Landrush server also made use of a viewing distance of nearly 2000 blocks. Some objects or features are only half the fun if you cannot use "far view" once in a while and have that view display a little more the just the immediate surroundings of the places you have just been. I don't know what the viewing range on the Landrush server was at the time but climbing the mountain to have most of it's blocks displayed and kept in memory was some hell of a job. I don't know if roaming the landscape on the "Just Test" server wouldn't be too difficult if I couldn't see my own feet. ;-P

Re: Guide to create fast minetest server on Linux

PostPosted: Wed Nov 05, 2014 15:58
by lag01
twoelk wrote:I don't know if roaming the landscape on the "Just Test" server wouldn't be too difficult if I couldn't see my own feet. ;-P

Well, recently i cut down max_block_send_distance from 9 blocks to 6 blocks (96 nodes/meters), i think, performance improvement which server gained, was worth it.

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Nov 06, 2014 03:38
by twoelk
lag01 wrote:...
Well, recently i cut down max_block_send_distance from 9 blocks to 6 blocks (96 nodes/meters), i think, performance improvement which server gained, was worth it.

hehe - so now nobody can see my castle retreat when aproaching the little hill it is perching on and scraping the clouds.

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Nov 06, 2014 13:40
by Joz
If you just use redis, which stores many blocks in RAM per default (or leveldb maybe) I think it is very fast also. Nearly as fast as RamFS and more-often backups.
Minetest world settings for redis: http://wiki.minetest.net/Database_backends#Redis
Redis quick start, also for debian: http://redis.io/topics/quickstart
Alternatively sudo apt-get redis-tools or something like this

Re: Guide to create fast minetest server on Linux

PostPosted: Sat Nov 22, 2014 04:13
by cesarpachon
@lag01: thank you for the detailed description! I am new to minetest and had been playing for a couple of days with a amazon ec2 instance and this info is really useful!

ssh

PostPosted: Sat Jun 27, 2015 08:14
by amadin
deleted

Re: Guide to create fast minetest server on Linux

PostPosted: Wed Jul 08, 2015 19:13
by TuxerP
@lag01
I see that you are running debian jessie which runs systemd. I am running ubuntu 15.10 which also runs systemd. When I add the mount option before start en after the stop daemon in my /etc/init.d/minetest-server script and restart. Nothing happens.
Can you help out?

This is part of my /etc/init.d/minetest-server file:

# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi

mount /var/games/minetest-server/.minetest/worlds/world/players
chown Debian-minetest:games /var/games/minetest-server/.minetest/worlds/world/players/
cp -rp /var/games/minetest-server/.minetest/worlds/world/players.safe/* /var/games/minetest-server/.minetest/worlds/world/players/

minetest_start() {
start-stop-daemon \
--start \
--quiet \
--pidfile $PIDFILE \
--oknodo \
--background \
--exec $BINARY \
--startas $DAEMON \
--make-pidfile --chuid $USER \
-- $DAEMON_OPTS > /dev/null 2>&1 || return 1
return 0
}

minetest_stop() {
start-stop-daemon \
--stop \
--quiet \
--pidfile $PIDFILE \
--oknodo \
--exec $BINARY || return 1
rm -f $PIDFILE
return 0
}

#cp -rp /var/games/minetest-server/.minetest/worlds/world/players/* /var/games/minetest-server/.minetest/worlds/world/players.safe/
#umount /var/games/minetest-server/.minetest/worlds/world/players

case "$1" in
start)
log_begin_msg "Starting $DESC: $NAME"
minetest_start
log_end_msg $?
;;

And my fstab file

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/minetest--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=42d02e8c-e515-4162-b1d1-4e57f77f11fe /boot ext2 defaults 0 2
/dev/mapper/minetest--vg-swap_1 none swap sw 0 0
ramfs /var/games/minetest-server/.minetest/worlds/world/players ramfs defaults 0 0

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Jul 09, 2015 17:55
by trukoil
Don't know how LevelDB runs for a server (goes well in singleplayer) but it's just a changed line in world.mt

By the way:
lag01 wrote:Well, recently i cut down max_block_send_distance from 9 blocks to 6 blocks (96 nodes/meters), i think, performance improvement which server gained, was worth it.


Didn't thought that block != node.

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Jul 09, 2015 18:57
by lag01
trukoil wrote:Don't know how LevelDB runs for a server (goes well in singleplayer) but it's just a changed line in world.mt

By the way:
lag01 wrote:Well, recently i cut down max_block_send_distance from 9 blocks to 6 blocks (96 nodes/meters), i think, performance improvement which server gained, was worth it.


Didn't thought that block != node.

Would be nice to have another good option, instead of randisk... But, as i read in wikipedia about LevelDB, there is nothing about casching in memory and there is no indexing.

"Blocks" and "nodes" terminology is used in minetest mapformat description, so i try to honor that naming convention.

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Jul 09, 2015 19:27
by ExeterDad
But, as i read in wikipedia about LevelDB, there is nothing about casching in memory


No need to cache in memory. The database IS in memory. That's why it's so fast. But... you must have enough memory to accommodate the database or you will run out of memory for the server to run on.

Re: Guide to create fast minetest server on Linux

PostPosted: Fri Jul 10, 2015 12:49
by TuxerP
I am trying to run a server that you can play from a mobile device. Mobile devices have limited amounts of cpu and memory, so server optimization is a thing that is important. I have tuned my minetest.conf settings so the amount of data send to the mobile device is not to much to have good fps and so little lag as possible.
Running on leveldb, redis or running players and maps in memory will be a faster option than running sqlite I think.
Also I try to run stable mods.

Re: Guide to create fast minetest server on Linux

PostPosted: Fri Jul 10, 2015 18:51
by ExeterDad
TuxerP wrote:I am trying to run a server that you can play from a mobile device. Mobile devices have limited amounts of cpu and memory, so server optimization is a thing that is important. I have tuned my minetest.conf settings so the amount of data send to the mobile device is not to much to have good fps and so little lag as possible.
Running on leveldb, redis or running players and maps in memory will be a faster option than running sqlite I think.
Also I try to run stable mods.

From my limited experience using Android on our server. Less is more. Using games or mods heavy in textures/sounds will kill our devices the fastest. And as you said, it boils down to limited memory. All media is downloaded to the devices when logging in. Even textures for nodes that you may never see the entire time you are logged in with the device. My Android, and it's not too shabby... will crash while loading the media when our server is running a BFD instance. It plays a default game map like a dream. But the heavier it gets, the more likely it will crash.

Re: Guide to create fast minetest server on Linux

PostPosted: Mon Jul 13, 2015 08:10
by amadin
I think this guide the developers must put in wiki, because with default minetest.conf - parts of the world loading very-very slow if more than 30 people online on powerfull server.

Re: Guide to create fast minetest server on Linux

PostPosted: Wed Jul 15, 2015 21:12
by lag01
Right now i am working on improving this ramdisk setup.
Here i attached halfway ready code for using ramdisk.
Also other useful functions, like backup, clear player profiles, keep service up.

To use this install, minetest must be installed, and there must be correct user and world folder names. Also map.sqlite and debug.txt must be present in the right places.

Can somebody help me improve install.sh to automatically add crontab entries (like in crontab.txt)?

Re: Guide to create fast minetest server on Linux

PostPosted: Thu Nov 26, 2015 19:35
by amadin
Do you can add parameters of your server (processor, hard drive (ssd, sata or ata), ram (ddr or sdram), network speed) or add it to your post here viewtopic.php?p=162449#p162449?

Re: Guide to create fast minetest server on Linux

PostPosted: Fri Nov 27, 2015 11:04
by Calinou
If you have spare CPU and bandwidth, you can use this:

Code: Select all
dedicated_server_step = 0.05


This will make player/mob movement appear to be smoother and more accurate (and any other action that occurs every server step).

Re: Guide to create fast minetest server on Linux

PostPosted: Mon May 01, 2017 18:22
by BBmine
Nice, lag :)
Any idea on why my server is not announcing to the serverlist, but other people from all over the world can still join?

Re: Guide to create fast minetest server on Linux

PostPosted: Mon May 01, 2017 18:56
by lag01
BBmine wrote:Nice, lag :)
Any idea on why my server is not announcing to the serverlist, but other people from all over the world can still join?

Thanks Baggins!
Not sure about your server. Did you check minetest.conf?
Code: Select all
server_address = 45.21.218.32
server_announce = true
serverlist_url = servers.minetest.net

Re: Guide to create fast minetest server on Linux

PostPosted: Sat Jul 08, 2017 01:31
by BBmine
lag01 wrote:
BBmine wrote:Nice, lag :)
Any idea on why my server is not announcing to the serverlist, but other people from all over the world can still join?

Thanks Baggins!
Not sure about your server. Did you check minetest.conf?
Code: Select all
server_address = 45.21.218.32
server_announce = true
serverlist_url = servers.minetest.net

Beerholder showed me what it was :D I should've done this:
Code: Select all
curl_timeout = 10000

Apparently the default is too low.