Hidendra / LWC

Lightweight Protection for Chests, Furnaces, Dispensers, and more for the Minecraft server mod Bukkit
Other
167 stars 123 forks source link

Issue with Pistons extending/retracting causing Lag on a server #602

Open UnDrac opened 11 years ago

UnDrac commented 11 years ago

I noticed this after I tried to make an automated farm with Pistons

Normal pistons when extending even if I set them all to extend at the same time ... they do so in sequence one after the other ... but when they retract they do so as designed.

Sticky pistons seem to have this issue in both cases ... when extending and retracting they are sequenced one after the other.

Using nolagg examiner I found out it was LWC ... dunno what or why it happens but LWC lags the whole server if about 100+ pistons are extending/retracting constantly ... even with almost 1000 pistons It doesn't crash the server but it does seem to prioritize whatever LWC is doing when a Piston is trying to move something.

Chrispm84 commented 11 years ago

I have the same problem. Any help on this issue?

tara81 commented 11 years ago

yikes I hope I dont have many pistons on my server =(

Chrispm84 commented 11 years ago

Yes, indeed. :)

treydun commented 11 years ago

LWC has a piston check to make sure no one is using a piston to break a protection. A few simple tests you can do to observe this in game is place a sign, lock it and then extend a piston towards the protected sign. The piston will freeze in the open position and cannot retract even after you remove the protection. This prevents people from using a piston to remove the block under a LWC protected door or beside a LWC protected trapdoor causing the door to pop off. Non sticky pistons only check the extension because they cant pull a block on the retraction. This is also why LWC takes priority. Griefers could just build a large piston device and overwhelm the server allowing them to break protection. Also having a large scale server with many LWC locked items can make it worse.

I suspect the reason it separates the piston firing in between checks is because if it tried to check 100+ piston actions against the entire LWC database all in a single tick it could crash the server.

This is compounded by the fact that extending and retracting 100 pistons simultaneously is already a pretty heavy process on a server due to the block updates and redstone updates that all have to take place within a single redstone tick while LWC attempts to ensure that none of those pistons are being used to break into a protection.

I think the most you can hope for is a setting to disable piston checking which will allow griefers to break all door protections with a piston. In that case it will be up to you to decide between piston lag or cleaning up more messes. Using a world protection plugin can help prevent griefers from placing a piston in front of a door in the first place.

Chrispm84 commented 11 years ago

I understand all of this... The problem is that LWC used to NOT cause the TPS to drop. I've built much larger piston machines that didn't affect the server at all. What UnDrac and I are describing is something that performs much worse than it should, and in fact worse than it used to.

asilverking commented 11 years ago

I have the same problem with pistons. its really annoying not being able to make large auto farms with lwc.

MrPerhaps commented 11 years ago

I also experience this problem. Now I can't even build a simple redstone retractable hidden stair way without experiencing a large fall in TPS. It becomes a big hassle for my and my town members who also desire to make some sort of redstone contraption. I never had this problem before in the past and completely agree with Chrispm84's comment above. There has to be some way you can fix this bug while still keeping the anti-griefing aspect of the piston check.

UnDrac commented 11 years ago

I understand the need to protect blocks/entities locked by lwc from pistons, but it would have been better just to change the properties of the locked blocks to that of Obsidian or Bedrock.

We're currently using Towny and there's no way people can even begin to be able to use pistons to open locked doors or trapdoors unless they're griefing their own plots, and yet this feature was simply Forced onto those that didn't require it. I'd rather deal with the mess caused by Griefing Doors with pistons than to have people complain of Lag on the server when someone decides that it's fun to connect 660 pistons to a 2 tick redstone clock (me) while testing it to see what was causing the lag. It took the server almost 5 minutes to finish expanding and retracting all those pistons after a few seconds of being active.

We used to have Massive piston constructions on the server, and they didn't cause any lag. As soon as we updated lwc, those constructions were unusable due to the ridiculous lag they caused. I'm having to set up a redstone delay of up to 2 seconds every 8 or so pistons to keep the server from lagging.

All I'm saying is that I'd want to have it optional in the config rather than forced on.