Gendustry

Gendustry

35M Downloads

[Question] Is this normal usage/tick time for industrial apiaries?

utoc opened this issue ยท 4 comments

commented

I was having intermittent lag on my server today so I decided to briefly poll the server with sfPlayer's sampler tool. The screenshots below are from a 10 second sample:

http://i.imgur.com/pTEIIZm.jpg

http://i.imgur.com/5925FmD.jpg

What you see in this sample report is that in 10 seconds, 'isAcceptedFlower' was called 237 times. There are 19 industrial apiaries currently loaded on the server so that comes out to the method being called for each apiary every second, give or take. 2782ms total time used.

Anyway, my question is.. is this normal? Is it OK? Sorry to bug you, thanks for taking a moment to check this out. If you'd like the full nps file, it can be found here: http://bbqsauce.terron.com/gend-apiary.nps

Gendustry: 1.5.2.107
Bdlib: 1.9.1.97
Forestry: 3.6.3.20
FML: 1448

commented

As you can see from that dump out of those 2782ms spent in my tick handler, 2670ms were in BeekeepingLogic.canWork/doWork which is in Forestry (and calls isAcceptedFlower among other things).

Forestry apiaries (of all types - including industrial from my mod) can be pretty CPU intensive, there will be some improvements in 4.0.

In general this dump looks weird, over 10 seconds canWork should have been called 200 times per apiary (assuming it's powered and not disabled by redstone). So either the server is having major TPS lag or something else is going on.

At any rate, the vast majority of that is in code Forestry and outside of my direct control.

commented

I just remembered something - hasFlowers does some caching of the result (for 550 ticks for positive results and 225 ticks for negatives, i think).

So most calls should be very fast while some are much slower - when it needs to actually scan all blocks around looking for flowers.

Due to how visualvm sampler (assuming that's what was used) works - basically it checks every X ms what function is executed right now - it will miss most of the fast calls but see all the slow ones.

That's why the number of calls is much lower than expected, while the time spent per call is surprisingly high.

commented

I used sfPlayer's sampler mod, VisualVM is what I'm using to read the NPS file that Sampler makes. Noted though, thank's bdew.

commented

canWork gets called every tick per every apiary? Wow! I checked the dump, it was called 238 times, the same number of times for hasFlowers. We don't have any tick problems; at the point where I made the nump, we were averaging 30ms tick times with a maximum of 161ms. The industraial apiaries in question were not shut off via redstone.

Thank you for pointing me in the right direction with the notion that it was a Forestry call. I appreciate it.