mojira.dev
MC-40715

Lag resulting from chain of command blocks

First off, I apologize about not quite following the suggested structure and the length of this post, but the issue is difficult to understand without the whole story.

Me and two other players were working on a parkour map that we'd been working on for quite a while. One day upon starting the server we encountered severe lag in a very particular area - a specific platform that was about 6 by 4 blocks. We threw several theories around, but the one made the most sense was that some sort of "ghost entities" were causing lag - a few days ago several animals had disappeared and the lag seemed to be happening in other areas where there had been animals. I loaded a copy of the world up in NBT Explorer and MCEdit to look for entities in those spots, but found nothing.

At the same time, my friends tried destroying some command blocks that they had suspected were causing lag on their copy of the map, and that solved all of the problems; no more lag in any of the spots. They loaded up the backup that had the command blocks intact and I joined to check it out.

I figured out that one circuit was causing the problem; it was a series of command blocks that were activated repeatedly in a sequence, one at a time. The command blocks used /playsound and /setblock. Removing one piece of redstone eliminated the charge and stopped the pulsing, and the lag in those specific places stopped. We tested this very carefully: my friend standing in the spot noticed lag immediately when I turned on the circuit and noticed it stopped immediately when I stopped it.

I then tested each of the command blocks individually; none of them caused lag, and all of them completed the correct functions. I tested them in groups, and found that two smaller groups of them caused no lag, but all of them together did.

So, to summarize: one particular sequence of command blocks causes lags in a few particular places (smaller than a chunk), and only when the command blocks are activated all in sequence, not individually or in smaller groups.

I don't think this is down to the power of our computers, the amount of RAM allotted to the server, the speed of our internet, or anything similar. We all have fairly powerful computers and good internet service.

I would think that one would have a lot of trouble reproducing the issue considering how specific it is, but I can attach the world and note the specific places, or paste in the commands, or take screenshots of the circuits if necessary. I also have access to server logs but I don't think they'll be of much use, as we searched them ourselves for errors and found none.

Comments 1

Lag is not a bug. It is a result of a computer having trouble calculating the complicated tasks that Minecraft wants it to.

Jackson Reed

(Unassigned)

Unconfirmed

command_block, lag, multiplayer

Minecraft 1.7.2

Retrieved