[INACTIVE][MECH] PerformanceTweaks v0.08 - Disc Usage Minimizer, And More [818]

Discussion in 'Inactive/Unsupported Plugins' started by LexManos, May 3, 2011.

  1. Offline

    LexManos

    PerformanceTweaks - Disc Usage minimizer, And Other performance tweaks
    Version: v0.08

    AutoSave Stopper:
    Instead of writing every chunk to the disc every 2 seconds. This changes it to 30 mins.
    This saves the server from writing about 9KBps to the disc (7 writes, 2 reads per chunk, on a 3 person server).
    As well as saves about 2 calls to deflate every 2 seconds. (per chunk)

    Chunk Persistance:
    Change how long chunks will stay loaded into RAM, instead of unloading instantly when not used. This way naturally high traffic areas will stay loaded, yet areas that someone was just passing through will unload after some time. This means you need SOME extra RAM but that extra RAM will actually give you a boost in performance while reducing the amount of reading and writing needed for the disk. Win-Win. This part can be disabled via the config file.

    Monster Limiter:
    The Monster limiter will disabled 'natural' monster spawning when the number of monster gets above the max threshold. Then it will re-enabled it when the monsters get below the threshold - 100. Note: Monsters spawn in groups so this is a rough threshold. The limit can be set in the configuration. You can also completely disable this there as well. Let me know how this works out for you.

    Features:
    • Massively reduces needless disc usage
    • Chunks stay in RAM longer
    Download wget friendly
    Download Source Here
    Donation Link[​IMG]

    If you have any other ideas let me know I can look into if they are feasible or not.
    60 Seconds Without the plugin on a idle server:
    [​IMG]
    Average Disc Traffic: 1041Bps
    60 Seconds With the plugin on as idle server:
    [​IMG]
    Average Disc Traffic: ... none.

    Changelog:

    Verion 0.08:
    • Updated to MC 1.6.6 RB 813
    Version 0.07:
    • /save-all now forces saving player data as well. Thanks PhantomGamers
    • Fixed NPE on Disable/Reload when MonsterLimiter was disabled. Thanks the like.. 60 of you who repeatidly reported it u.u
    • Added Perliminary Miltiverse world specific Monster Limiter configuration. Please test
    • -Changed MonsterLimiter config to yml.
    • Potential fix for a NPE in Chunk Persistance.run
    • Temporary fix for a Concurancy exception in MonsterLimiter.run();
    Version 0.06:
    • Re-wrote how monster Limiter works
    • --Added config option for allowing animals/monsters separately.
    • --Added a monitor thread, to catch edge cases where EntityDeath doesn't fire.
    • Changed how Persistent Chunks refreshing works, lowering the CPU impact.
    Version 0.05:
    • Changed how Chunk persistence works.
    • -Should get rid of any and all concurrency errors. Chunks are now unloaded by Bukkit itself in doTick()
    • -It will not try to unload spawn chunks any more.
    • -Chunks are new 'refreshed' when players move.
    • Added the /ptml command for debug info.
    Version 0.04
    • Added Monster Limiter
    Verions 0.03
    • Added Chunk Persistance
    Version 0.02
    • Added Configuration
    Version 0.01
    • First Release
     
    lemachinbidule, omnija, nacs and 13 others like this.
  2. Offline

    Venatius

    I'd really like to encourage making a single, permanent URL for your mod (one that won't change with updates) and providing that to the CraftBukkitUpToDate mod author for inclusion. It's a really handy utility, makes it very easy for your plugin users to get your updates without having to continually check the forums. As far as I can tell your plugin isn't currently supported there. All you need is a download address where the plugin can consistently know to check for updates. This might necessitate a file host change - I don't know if your current one'll work with it or not. It might! Just something to consider.
     
  3. Offline

    blindsarcasm

    Very nicely typed. But using your brain, you could've figured this out easily. Get the link for wget friendly and stick that into your CBUTD links. And you're set to go. Sounds very copy&pasted though.
     
  4. Offline

    Vhab

    We've been using this for a while now to keep the server load under control.
    And I must say it's an excellent plugin. I hope you keep supporting it in the future.

    Thank you.
     
  5. Offline

    Venatius

    And using your brain, you might have considered, before employing unwarranted snark, that I had more in mind than just updating it for myself.
     
  6. Offline

    ShadowDrakken

    A lot of us are sick of seeing people spam that useless updater across every thread on the forum.

    The updater needs to be setup to allow for versioning and build checking before it's even worth looking at being taken seriously

    I know I'm not the only person that keeps my plugins versioned in order to keep track of things.
     
  7. Offline

    Phaedrus

    You are probably right, but this isn't the place for this discussion.

    Anyway...
    I've stopped using this plugin for now. After starting to use it we got several missing chunks pop up near spawn. The entire chunk down to bedrock just disapears. And if that's not bad enough, we started getting some massive errors in the console about chunk deflating and after a reboot massive areas of the map were complete regenerated. It looked like the entire map, except for the area directly around spawn was freshly generated. It even cut cleanly through buildings. I had to restore from a back up. I'll try and post the error log later tonight. I saved the corrupted world data as well. I'm not 100% certain that it was this plugin that caused it, but it was the only recent addition and things have gone back to normal since it was removed. It's a shame, i hope it gets worked out.
     
  8. Offline

    rtcabooservb

    Did you disable chunk persistence?
     
  9. Offline

    Phaedrus

    Nope. I didn't have much time to experiment with it. As it is, I had to take the server down for about 30 minutes to roll back the corruption.

    I've got litterally 60000 lines of error msgs like this:

    Code:
    net.minecraft.server.ChunkRegionLoader.a(SourceFile:64)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:160)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkProviderServer.saveChunks(ChunkProviderServer.java:190)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.World.save(World.java:148)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.saveChunks(MinecraftServer.java:226)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:255)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:322)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    2011-05-22 16:48:37 [SEVERE] java.io.IOException: The handle is invalid
    2011-05-22 16:48:37 [SEVERE] 	at java.io.RandomAccessFile.seek(Native Method)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.RegionFile.a(SourceFile:342)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.RegionFile.a(SourceFile:279)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkBuffer.close(SourceFile:259)
    2011-05-22 16:48:37 [SEVERE] 	at java.util.zip.DeflaterOutputStream.close(Unknown Source)
    2011-05-22 16:48:37 [SEVERE] 	at java.io.FilterOutputStream.close(Unknown Source)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkRegionLoader.a(SourceFile:64)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:160)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkProviderServer.saveChunks(ChunkProviderServer.java:190)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.World.save(World.java:148)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.saveChunks(MinecraftServer.java:226)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:255)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:322)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    2011-05-22 16:48:37 [SEVERE] java.io.IOException: The handle is invalid
    2011-05-22 16:48:37 [SEVERE] 	at java.io.RandomAccessFile.seek(Native Method)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.RegionFile.a(SourceFile:342)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.RegionFile.a(SourceFile:279)
    2011-05-22 16:48:37 [SEVERE] 	at net.minecraft.server.ChunkBuffer.close(SourceFile:259)
    2011-05-22 16:48:37 [SEVERE] 	at java.util.zip.DeflaterOutputStream.close(Unknown Source)
    Any ideas? Is it this plugin? Or something else? Only other block/chunk related plugin I use is BigBrother
     
  10. Offline

    ledhead900

    Come to think of it I have a new 1gb size 7000x7000 size map and this + that + latest reco build thing get a bit iffy.

    Im not sure the root cause at all but this is the only thing effecting chunks persitence in anyway basicly what is going on is upond login chunks are taking a while to show up and somtimes dont at all until u refresh your view distance.

    Then there is an issue with inv goin client sided at times. :( any ideas on that ? It was working fine with my last map and 766 but 803 and Im not sure if its map or this or something else.


    Here is my configs you have any advice for tuning these so chunks load faster and stay loaded longer.

    PHP:
    #enable: If this part of the plugin should be enabled at all.
    #lifetime: The minimum lifetime of chunks in milliseconds.
    #prune: The number of milliseconds before each prune cycle. Lifetime should not be less then this.
    #Sat May 14 22:36:24 EST 2011
    lifetime=300000
    prune
    =5000
    enable
    =True
    #interval: The number of ticks {1/20th second} between each Mini-Save.
    #Sat May 14 22:36:24 EST 2011
    interval=36000
     
  11. Offline

    rtcabooservb

    I am currently using a 4gb size map (20800x12600) and haven't ran into any problems yet. I keep chunk persistence disabled because I ran into a few issues on the last map I had with missing chunks. I think due to high overload in the server, when it purges (refreshes) saved chunks, the chunks get lost in limbo, resulting it disappearing. Sometimes a simple restart fixes it, sometimes you need to import the save back through recent backups. I may be 100% wrong though, but I do keep chunk persistence off.
     
  12. Offline

    LexManos

    Anyone who is having missing chunk problems, just disable the chunk persistance plugin, thats the reason it has a config option to compleetly disable it -.-

    I'll go through and look into it again but Honestly, it is simply notifying MC that it can unload a chunk exactly as if you walk away from it. So Im not sure how it could be causing so many issues.
    But anyways, as for the Error Phaedrus is getting, that sounds like something is fucking up with your hard drive. Its causing the file system to forget that you are accessing the file. I dont see how my plugin could be causing it.
     
  13. Offline

    ledhead900

    Good call I dont have that bad an issue maps not corrupting just loging in and tp makes the map take for ever to show like I can see thru to bedrock but as soon as relog of change view setting/fog map loads instantly ? is this a MC bug also what do u think is the issue with my client sided items.

    For example u can drops items fine then after soem time of playing u drop them but they appear in the inv still unil your click ur inv. Its almost like bukkit or something is cuasing updates to events to go missing during sending. Btw Im connecting localy.
    All the settings I use now of my server backend worked for past 4 bukkit builds no on 3 worlds no issues. Now I got one world and I have issues with that sometimes.
     
  14. Offline

    tha d0ctor

    hey, does this autosave the world when you use a command like /reloadall or when you type /save-all
     
  15. Offline

    Phaedrus

    Well I'm running on a ramdisk, so I don't think it's a problem with the drive. Looking through the error logs again there appears to be some BigBrother/MySQL errors as well, so that might be part of it... not sure.

    Everything has been fine since removing PerformanceTweaks so far. I'll maybe give it another shot with chunk persistence disabled when I get a chance.

    Keep up the good work.
     
  16. Offline

    Blackstorm72

    Just having a monster limiter really is nice, it helps out CPU performance here.
     
  17. Offline

    ledhead900

    I agree but since turning of persitence my issues went away with the chunks taking to long to load or not at all until gfx change and sometimes the items in inv would become client sided.

    No issues for 2 hrs straight with out the chunk part of this plugin enabled. I still use the mobs part of this limiting the mobs to 1000 per world, at the same time I use Monstertamer to bring persiteence to mobs so they dont despawn on there own, Go go project Chickencoop.
     
  18. Offline

    creepycreeper

    Ermm, when will this be updated for the latest recommended build?
     
  19. Offline

    fffizzz

    works fine with 803
     
  20. Offline

    desmin88

    @LexManos
    Jesus Christ man,
    Stop being non-threadsafe. You make new threads and call bukkit api methods.
    This can cause data corruption and wholly of new errors. It's very dangerous, and can destroy entire maps. It even conflicts with my plugin.
    Fix it, please.
     
  21. Offline

    LexManos

    All Bukkit code that I call from other threads are READING only, the one write that I do is to the 'unload queue' list, and it shouldn't cause any issues because if it does, throw a concurancy error MC will just keep trudging along and try again later.
    MC itself needs to be re-written in a thread safe manor.

    Anyways, if it screw with your plugin then disable chunk persistance the option is there for a reason.
    Chunk Persistence is going through many changes until I find just the right method to work around the bull shit that is Minecraft's code.
     
  22. Offline

    desmin88

    @LexManos
    I disagree. In your ThreadedSave.java I blatantly see methods where you save worlds, in a new thread.
    My plugin is thread-safe. Yours isn't. Please update accordingly.
     
  23. Offline

    LexManos

    ThreadedSave is code that is never run.
    Its a side project that I am testing to see if it work.
    Please stop being a ass unless you understand what you're talking about.
     
  24. Offline

    desmin88

    Meh. My point still stands, you shouldn't be creating new threads at all. BukkitScheduler was made for a reason.
     
  25. Offline

    LexManos

    Actually there are plunty of reason to create new things. Anything that you can run on your own time, that does not require the rest of the server to halt and wait for you, should be made into your own thread.

    Yes the scheduler was made for a reason, but the whole idea of ThreadedSave was to offload the saving to a different thread so that it does not hold up the main world simulation. The #1 issue players have with minecraft is the major lag that saving the entire world causes. I was curious how simple it would be to fix so I tried. It failed horribly hence why it isnt actually part of the plugin. I will be modifying it sometime in the future to make it more thread-safe and if, at some point I do succeed in offsetting saving without detrimental effects to the server I will release it.

    The added benefit of moving as much as you can away from the main simulation thread in a game that needs every ounce of performance help it can get. Is a good ting.
     
  26. Offline

    Sleaker

    Uhh why not? why can't you run a thread and make a callable that gets called onto the main thread to do the saving? Seems to work just fine for me..
     
  27. Offline

    Craig1690

    Is this compatible with 818 ?
     
  28. Offline

    rekcon

    I have gotten the following error while breaking blocks in a region:

    Code:
    13:50:14 [SEVERE] java.lang.NullPointerException
    13:50:14 [SEVERE]       at org.jbls.LexManos.ChunkPersistance.run(ChunkPersistance.java:154)
    13:50:14 [SEVERE]       at java.lang.Thread.run(Unknown Source)
    This causes dynmap to render an area without a chunk like so:
    [​IMG]

    However, it does not seem to affect ingame chunk rendering, only dynmap rendering. This leads me to believe it is somehow dynmap related, even though it occurs in the PerformanceTweaks code.

    This has happened twice. I am running 819. I understand it isn't currently supported, but I figured I would bring it up. I've not seen it posted recently.
     
  29. Offline

    Liger_XT5

    I don't know if it's me, but the normal download link seems broken :/
     
  30. Offline

    LexManos

    Its you.
    Im working on a few ideas for chunk persistance. If you ahve issues as always just turn it off.
    Once my server gets upgraded to 818 i'll test it out more.
     
  31. Offline

    ledhead900

    same thing here 2011-06-04 22:44:43 [SEVERE] java.lang.NullPointerException
    2011-06-04 22:44:43 [SEVERE] at java.util.Hashtable.get(Unknown Source)
    2011-06-04 22:44:43 [SEVERE] at org.jbls.LexManos.ChunkPersistance.run(ChunkPersistance.java:154)
    2011-06-04 22:44:43 [SEVERE] at java.lang.Thread.run(Unknown Source)

    Turning off chunk peristance btw im on 820
     

Share This Page