mushroomhostage / exphc

The Experimental Hardcore Post-Apocalyptic Minecraft Server
www.exphc.com
8 stars 5 forks source link

Lag near craters #23

Closed mushroomhostage closed 12 years ago

mushroomhostage commented 12 years ago

Craters from Cake's Miner Apocalypse cause lag because of the excessive block drops.

mushroomhostage commented 12 years ago

I think Mortuus Terra tried to fix this by replacing exploded TNT craters with manual block generation.

mushroomhostage commented 12 years ago

Some options to consider:

mushroomhostage commented 12 years ago

Added RemoteToolkit for automatic restarts. Tested CB++ but unable to open RedPower GUIs (IC2 GUIs worked fine).

Reproduced lag near craters on test server, /tpc -6600.0 80 -7016.0, no one else on the server, lag immediately dropped to 13.3 tps, periodically sampled at 14.2, 15.0, 15.5, and then 20 tps presumably once the entities expired.

mushroomhostage commented 12 years ago

Testing with ClearLagg, it immediately clears hundreds or even thousands of entities near craters. However its config needs some work: by default, it runs every 10 seconds(!) and logs how many entities it clears, and it clears everything - paintings, boats, minecarts (even those occupied!) included. But you can disable automatic clearing and certain entities in the config, then manually run /lagg clear as needed. Trying with config:

#--broadcast on console removal--#
console-broadcast-removal: true

#This is how long it takes for the server to auto-run lagg clear
#To disable this, put -1
InitialDelay: -1
#This goes by seconds!
#600 = 10 minutes

#--Removal options--#
remove-boat: false
remove-xp: false
remove-painting: false
remove-projectile: true
remove-item: true
remove-minecart: false
remove-ready-tnt: false
remove-fallingsand: true
remove-arrow: true
remove-snowball: true
remove-fireball: true
remove-EnderSignal: true

#--Removal options for mobs--#
remove-creature: false
remove-animals: false
remove-monster: false
mushroomhostage commented 12 years ago

852 craters according to server.log.

mushroomhostage commented 12 years ago

To generate list of commands:

grep Crater server.log*|perl -pe's/.*at //g'|perl -pe's/ / 100 /g'|perl -pe's/^/\/tpc /g'|perl -pe's/$/\n\/lagg clear/g'
mushroomhostage commented 12 years ago

While testing drops also noticed NPE from CMA:

16:21:59 [SEVERE] Could not pass event EntityExplodeEvent to CakesMinerApocalypse
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:441)
    at net.minecraft.server.Explosion.a(Explosion.java:202)
    at net.minecraft.server.World.createExplosion(World.java:1556)
    at net.minecraft.server.WorldServer.createExplosion(WorldServer.java:240)
    at net.minecraft.server.EntityTNTPrimed.explode(EntityTNTPrimed.java:88)
    at net.minecraft.server.EntityTNTPrimed.G_(EntityTNTPrimed.java:66)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1277)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:106)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1259)
    at net.minecraft.server.World.tickEntities(World.java:1158)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:548)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:455)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
Caused by: java.lang.NullPointerException
    at org.bukkit.craftbukkit.block.CraftBlock.getState(CraftBlock.java:223)
    at me.cakenggt.CakesMinerApocalypse.CakesMinerApocalypseNuke.nukeAugment(CakesMinerApocalypseNuke.java:54)
    at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
    ... 14 more
mushroomhostage commented 12 years ago

https://github.com/mushroomhostage/CakesMinerApocalypse/commit/53767d45292f242f2324d043e62df68dc2c747be

mushroomhostage commented 12 years ago

ClearLagg has one problem, its /lagg clear command doesn't work from the console. Added to ExphcTweaks instead:

https://github.com/mushroomhostage/ExphcTweaks/commit/a2ce390572d01cf3b9a3b51df19eb728528e25e3 Add /clear command for ops to remove item drops near a player, to reduce lag (like ClearLag plugin but works from console)

mushroomhostage commented 12 years ago

Installed ClearLagg on production, tried /clear lagg, it cleared about 3000 entities. Removed it though in favor of ExphcTweak's /clear. Now can target 200 block area around any player for clearing entities.

mushroomhostage commented 12 years ago

Note, can't use integrated CB++ build (at least build 20) due to http://www.mcportcentral.co.za/index.php?topic=2034.msg11157 [CB++ 20] Unable to open RedPower2 GUIs if IC^2 installed (works in MCPC 56)

mushroomhostage commented 12 years ago

Added /loadchunk command and '/clear all' to ExphcTweaks. Generated list of commands to load all chunks at craters

def cmd(x,z):
    print "loadchunk world %s %s" % (x, z)
    print "clear all"

for l in file('craters.csv','r').readlines():
    l = l.strip()
    x, z = l.split(" ")
    x = int(x)
    z = int(z)
    r=5
    for i in range(r):
        for j in range(r):
            cmd(x+i*16,z+j*16)
mushroomhostage commented 12 years ago

Ran the first 1000 commands generated, cleared a bunch of entities.

mushroomhostage commented 12 years ago

Finished running all 60000 or so commands to load all chunks and clear entities within 5 chunks of generated craters. All complete. 20 tps. Should be fixed now.