What does server_unload_unused_data_timeout really do ?

Post Reply
Minix
Member
Posts: 19
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

What does server_unload_unused_data_timeout really do ?

by Minix » Post

Ok let me explain, I run a server and I'm constantly running out of memory because a lot of mapblocks are loaded in memory, so I was tweaking minetest.conf, specifically server_unload_unused_data_timeout, however I don't understand what it really does and I haven't found a post that talks about this.

Expected functionality: the integer value you set in this setting should be the number of seconds it takes for the server to unload mapblocks from memory after ABM finishes working on that mapblock (all players leave the area). This way only mapblocks that are under ABM and those that haven't timed out yet are still in memory so performance improves and memory is not wasted.

From experimenting that is not what that setting does. I did the following experiment:

Created a new default minetest 5.3.0 stable server and started exploring spawn and different areas recording memory usage with different timeout values:

With the timeout set to 1, memory usage started from 50 MB and only went to 60 MB after exploring an area with radius of 300 nodes.

Timeout (default) 29 started at 50 MB and maxed at 150 MB after exploring, even 30 minutes after logging out of the server, memory usage was the same 150 MB.

Then I set the timeout to 100 and explored the X axis from node 0 to 3000, memory usage went from 50 MB to a maximum of 250 MB. Even after 3 hours memory usage was the same, and it didn't get any bigger so that leads me to think that value is just a memory cap for the server so that it uses as much memory as it can for mapblocks but unloading those that are not in use to not exceed that value.

Another weird thing, in my main server I noticed that when a player explores a large area I get warnings such as:

WARNING[Server]: active block modifiers took 201ms (processed 236 of 251 active blocks)

I know that's just because my cpu and i/o are crap but the weird thing is that the number of active blocks sometimes reaches 500 even though active_block_range is set to 3 and only one player is on the server. So I think that for some reason mapblocks are just kept loaded in memory and ABMs are always running on those mapblocks ?? I am confused, please explain this to me, and thanks for reading this wall of text lol
FreedomTest anarchy server viewtopic.php?f=10&t=25702

Festus1965
Member
Posts: 1436
Joined: Sun Jan 03, 2016 11:58
In-game: bye bye

Re: What does server_unload_unused_data_timeout really do ?

by Festus1965 » Post

one thing is the time mt keep loaded map-blocks in memory

other thing is what is the maximum memory it was allowed to use,
what might be useless after some time not visited (activated) and might be allowed to disappear from memory (from HD reload if needed)

(here with 32 GB RAM about - htop 33 GB virtual, 27 GB reserved, SHR 20 GB - real Mem 7.6 GB in use)

maybe a release will happen, if you start something else, what want mem and so mt is forced then to free it ?
Minetest has no future

Minix
Member
Posts: 19
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

Re: What does server_unload_unused_data_timeout really do ?

by Minix » Post

Festus1965 wrote:
Sat Nov 14, 2020 11:48
one thing is the time mt keep loaded map-blocks in memory

other thing is what is the maximum memory it was allowed to use,
what might be useless after some time not visited (activated) and might be allowed to disappear from memory (from HD reload if needed)

(here with 32 GB RAM about - htop 33 GB virtual, 27 GB reserved, SHR 20 GB - real Mem 7.6 GB in use)

maybe a release will happen, if you start something else, what want mem and so mt is forced then to free it ?
Yeah if for example minetestserver is using 50% of the system memory, then if other programs need memory usually some of minetest's data is sent to swap memory but that fills the swap memory really quick. So far what I have done to keep physical memory and swap usage in acceptable levels is to decrease server_unload_unused_data_timeout to 800, previously it was 1800 and minetest was using like 2 GB of RAM between physical memory and swap.
FreedomTest anarchy server viewtopic.php?f=10&t=25702

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests