active block modifiers took 1015ms (longer than 200ms)

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

any way to idk fix this or works around it...

no my computer is not slow either :) thats what alot of this has been blamed on... is there more information about what this does or means?

my computer-> 2 physical processors 4 cores each at 3ghz, 64gb of ram, 4gb video memory, only running minetest server and client.

when it does this it really messed up my mod... puts blcks back that have already been mined.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

I question the loop in the block of code this warning comes from

https://github.com/minetest/minetest/bl ... .cpp#L1166

It looks to me like there would be instances where that loop would keep running ABMs on active map blocks until it ran for 200ms. If you remove the loop ABMs work fine from my testing and the warning disappears.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by rubenwardy » Post

I don't think so, the bit that is timed is here: https://github.com/minetest/minetest/bl ... 1173-L1198

It's the time for all ABMs to run.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

But the only time the Do..While is broken out of is if m_active_block_interval_overload_skip > 0 and m_active_block_interval_overload_skip is only changed in that loop when the timer is over 200ms unless I'm missing something.

Plus it loops through all active blocks twice in this section, once for node timers and once for ABMs, can't they both be handled in one loop through the active map_blocks?

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

So it looks like nothing changed recently performance wise, they changed this warning to using warningstream instead of infostream.

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

hold up... does this mean the game kills the abm if it runs too long... becasue if so i found my bug :) i been beating my mod code to death for this one specific error where it is breking bricks and all the sudden just misses one section... and if minetest kills the abms becasue they were too slow this would be the result.

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

it does it most after i run the code a few times. not instantaneously. when you have an abm remove 100x100x100 blocks its gonna take more than 200ms especially if the loop repeats until the machine is out of fuel...

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

No it shouldn't cut the ABM short. I think if all the ABMs for the active blocks take more than 200ms then it starts skipping ABMs on the next pass through.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by duane » Post

BrandonReese wrote:But the only time the Do..While is broken out of is if m_active_block_interval_overload_skip > 0 and m_active_block_interval_overload_skip is only changed in that loop when the timer is over 200ms unless I'm missing something.
That's a "do {} while(0)". Doesn't that mean it never repeats?
Believe in people and you don't need to believe anything else.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

duane wrote:That's a "do {} while(0)". Doesn't that mean it never repeats?
Yep you're right. That's what I was missing. Makes a lot more sense now.

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

soo... the short answer is change code, recompile and call it a day?

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: active block modifiers took 1015ms (longer than 200ms)

by BrandonReese » Post

Look at the changes I've made with my Adventuretest client. I've noticed considerable performance improvements with the changes I made in environment.cpp. I'm still testing it to see if there are any adverse affects.

https://github.com/Bremaweb/adventurete ... onment.cpp

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

ill compile it tommorrow and run it. maybe i wont have to move all my world stuff (probably will though)

tbillion
Member
Posts: 190
Joined: Wed Apr 03, 2013 16:07
Location: 38381, US, TN, Toone
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by tbillion » Post

got around to it a little later than i thought. my tests indicate both a solution and a problem. in your version of the client, i dont ever get the error about the abm taking too lon just now when it takes too long the server never comes back. you end up trapped in a invisible box because it cant generate the map (or update the client to tell the user things have changed) other than that your very right it feels alot smoother than the default client. lots less lag to me any how. i think if all holds out correctly i am just gonna change my code to use another method that doesnt involve an AMB. i can watch it in the console, in about 3 seconds it is done, but the game doesnt respond for 2 to 5 minutes. sadly it is looking like i will have to slow my code down to meet the speed of minetest.. kind of like when you move too fast and minetest resets you and you walk the same 5 blocks 15 times. :)

User avatar
SaKeL
Member
Posts: 743
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: active block modifiers took 1015ms (longer than 200ms)

by SaKeL » Post

im getting it in my game also... what is the best solution to optimize this ?

Code: Select all

WARNING[Server]: active block modifiers took 448ms (longer than 200ms)

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by Festus1965 » Post

Code: Select all

WARNING[Server]: active block modifiers took 230ms (longer than 200ms)
Getting the same some time, most around 230 ms. And new a mainly world (1 month), not much active, no mobs, no animals. hmmm

reading here: minetest.register_abm
... The Active Block Modifier consists of a function that is executed at a specific interval for single nodes.
... abms only work in active blocks,
there's the active_block_range setting telling how far blocks are active,
and abm_interval sets the Length of time between ABM execution cycles ...
so activated by player or forceloaded, but which one ...
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
SaKeL
Member
Posts: 743
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: active block modifiers took 1015ms (longer than 200ms)

by SaKeL » Post

its activated by time interval, so no player nor forceloaded..every block used in ABM config on the map is triggered by time interval what executes an function

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: active block modifiers took 1015ms (longer than 200ms)

by sorcerykid » Post

It would be nice if there was a bit more fine-grained control of ABMs, such as the ability to create, suspend, and delete them as well as more specific parameters (like boundaries, node beside, node above, node below, light above, etc.), so the ABM functions don't need to employ any more conditionals than they have to. That might help with optimization in many scenarios.

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by Festus1965 » Post

Even the server is empty, me and noeone else is in, I am getting this message now exactly every 08:33 mm:ss = 513 sec, (guess could be 500 set somewhere ?)
so ...
SaKeL wrote:its activated by time interval, so no player nor forceloaded..every block used in ABM config on the map is triggered by time interval what executes an function
where is that time set ?
And what does that warning mean in real, as I think a warning has some reason !
(Too long time using might ???`make a break, or problems to other actions, or loose the action, or what ever)

And how can I get more into that section of what block caused that late to see if that is a problem or just to understand how II can deny that problem by optimizing that area and its abm.

edit: 8.3.2018
I read it again and again:

Code: Select all

active block modifiers took 448ms (longer than 200ms)
"Took" longer ... with a specified time, that IT TOOK.

I am getting more relaxed, as for me that means it was done complete, and just reported about the longer time needed than a "set" maximum for a warning.

But why was 200ms selected, where I could set it higher, or get the information what in the abm makes it taking so long, that it seams to be a problem.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: active block modifiers took 1015ms (longer than 200ms)

by paramat » Post

You can use the built-in mod profiler to see which ABMs are taking a long time.
It's likely an intensive or poorly coded mod.

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by Festus1965 » Post

paramat wrote:You can use the built-in mod profiler to see which ABMs are taking a long time.
It's likely an intensive or poorly coded mod.
I do already: /profiler save - issues, questions - but I don't trust the result really. Just yesterdeys I got one step further ...

I modify Mods also like modifiing Vines in plantlife, and did more yesterday ...

So, I got back my lag = 0,09 including that pipeworks seams to take most of the cpu, but after looking not the sums, and focus more on the most ABMs using subtasks I got more successful, what makes my link 1 with the profiler more important first.

I got away the message about
* "too much Items in one Block, want to delete"
* "activate block modification takes longer than 200ms"
what was some step further, but as I made 5 changes I am not sure if one of them or all together made it.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by LMD » Post

Which were those changes ? Im facing pretty similar problems now.
My stuff: Projects - Mods - Website

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by Festus1965 » Post

First check out profiler with its "official" result and also check single ABM that take a lot of time,

in my case i stopped vines, they took too much,
and reduced switching stations on the LV, MV and HV networks, merging more of them together, as long cables doesn't matter yet

the other changes in the minestest.conf if will post next
but remember, everything there also depends on your (not) strong server and ability of RAM and read/write on HDD
my server only hosts the game with
* i7-4770 4 core, 8 threads,
* 16 GB Ram, and a
* very fast M.2 SSD, writing 2200, reading 2800, instead of normal HDD can do 200/s !!!

the server CPU gets only with the server (no Map Gen running) about 3/4 %,
* MapGen forces 1 thread to 100% /(cpu all about 15%), and makes lag to 2.4, normal is 0.1 until 0.25 with 16 people
and
* after running some time the cache map in ram is more then 5 GB already - so no need to read even from ssd ...
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by LMD » Post

Well my pc : 2 Ghz * 4 cores, pentium, 4 GB Ram, HDD 500 GB, 30/s, and my abms are FAR less often executed then once per second.
My stuff: Projects - Mods - Website

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: active block modifiers took 1015ms (longer than 200ms)

by Festus1965 » Post

if only for MTS, then should be ok,
so what about
* lag from one to 16 gamers,
* profiler results
??
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

Post Reply

Who is online

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