[MECH/EDIT ] Ptweaks v6.0.6 - Kill all server Lag! [1.7.5]

Discussion in 'Archived: Plugin Releases' started by Mrchasez, Sep 30, 2011.

  1. Offline

    Mrchasez

    This thread is outdated and wont be updated.
    Plugin is updated, but only here:
    http://dev.bukkit.org/server-mods/ptweaks-remove-all-server-lag/

    (Old posts)
    Show Spoiler

    Ptweaks -
    Version: 3.0
    CB: 1.2.4-R1.0

    DOWNLOAD (BukkitDev Download)
    BUKKITDEV LINK
    Normal Ptweaks 3.0 StartUp Here

    The Continuation of PerformanceTweaks LexManos However, It has almost been fully redone by me.


    VIDEOS:
    ====================================================
    VIDEOS:
    Thanks too Torrent for the video



    Thanks too BrandonHopkins for the video



    Lag Test 3,000 TNT / With and Without Ptweaks (356MB server)



    ======================================================


    About:

    Ptweaks is plugin to optimize your server, by changing chunk loading algorithms. Ptweaks is also huge on ram reduction, if you run a low ram server, or just want the improvements; Ptweaks is for you. Ptweaks also stops crashing and lag from TNT, and enables complex methods to improve your server in almost every aspect. Running a 16GB or 512MB Server, Ptweaks is for you.


    Testing:

    We ran 7 large plugins on a small 256MB server without PTweaks. The server couldn't load chunks, there was noticeable amounts of chat and block lag. The server was all around unplayable. We enabled Ptweaks and within minutes of being on, the chat and block lag we're gone. Chunk's loaded normal as they would on a 3GB Dedicated server.


    Features:

    • Massively reduces needless disc usage
    • Loads Chunks faster
    • Priorities Chunk's in the direction your facing, To ensure smooth game play
    • Keep chunk's loaded at a configured amount
    • Chunks with higher activity such as a spawn, stay loaded to massively reduce Ram usage
    • Limits Mobs and Animals to a configured amount
    • Disable Mobs and Animals
    • Check Current Ram being used
    • Config file's for each part of the plugin
    • Dupe TNT Packet's, So TNT will no longer cause any server side lag
    • Add's highly advanced Chunk Algorithms
    Feature Description:

    AutoSave: Instead of writing every chunk to the disc every 2 seconds. This changes it to a custom time that you want, Default is 30m. 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:
    This is a fully custom feature, that can be turned off. It will change how long chunks stay loaded. Chunks with lots of visitors will stay loaded longer, and not have to render again and again. This adding lots of performance to your server. This works for people just joining on that chunk or someone walking into it, So a spawn point works great with this. You can change how long they stay loaded, and how fast they unload. Default works for most though. This will no longer need extra ram.
    ======================================================
    Monster Limiter:
    This is another fully custom feature. You can change it to a certain amount of Mobs spawn, or if they spawn at all. You can turn Mobs off and animals on, or vice versa.You can set a minimum mob limit and a maximum, That the server wont go below or above. Fixing some lag that can happen from mobs spawning or not spawning at all.
    ======================================================
    SaveEdits:
    When the server starts to save, It slows down the processes to normal speed, Causing the save to be instant.
    ======================================================
    Ram Saver:
    Based on how the Ptweaks edit chunk loading, Ram drastically goes down. With the added features, such as slowing down disc usage. You can see up to a 80% Improvement
    ======================================================
    Chunky:
    Chunks in front of you get a higher priority too load then the ones to your side and back. Making smoother game play, and instant chunk loading.
    ======================================================
    TNT Edit:
    This makes TNT only really have to load once, then it is saved until the TNT packet stops. Causing TNT cause no lag at all, Under 10k TNT, which it will start to give off lag. TNT packets are also saved, after the first and just duplicated so you dont get spammed with them, and causing lag.
    ======================================================
    Installation:
    1. Download Ptweaks
    2. Stop your server
    3. Put Ptweaks.jar in your Plugins directory
    4. Start Your Server
    5. Edit Config's to your liking or leave default
    6. Relaod
    7. Done!
    Commands:
    • /ram - Checks Free / Total ram
    Permissions:
    PTML:
    Permission: ptml.has
    RAM:
    Permission: ram.has

    ChangeLog:

    [v3.0]
    • Stable Build
    • Added Whole new Chunk Loading algorithms thanks too Thulinma
    • Fixed Error where Chunk's wouldn't load
    • Chunk's now load faster
    • Chunks prioritize too load where the player is facing, before chunks to the side or behind
    • New Feature: ChunkEdits (@Thulinma)
    • Enabled Mob Features
    • You can only disable or enable Mob's from MonsterLimiter.yml for now, To disable set too 0
    • Fixed bug where you couldn't pick up mob drops
    • Fixed error on ChunkPersistance StartUP
    • Ram handler Update started
    • Updated too a stable Bukkit R1.0 Build
    • Removed separate listener files
    • Main now Implements listener
    • LET NEW PTWEAKS FOLDER LOAD
    Older Changelogs (open)
    Older Changelogs (open)


    [v2.0b]

    • Updated to CraftBukkit 1.2.4-R0.1
    • Added WorldListener
    • Changed all Files to YAML format
    • Added Enable options for Threaded Save and Monster Limiter
    • Changed Default Settings for more optimization
    • Started on Chunk Algorithm import
    • Fixed Bug where chunk's wouldn't load properly
    • Changed Start up code
    • Fixed Bug where you would fall into void on teleport
    • Fixed Faction Warzone bug where Mobs would fly when hit
    • Changed Util Color codes
    • Fixed Grammar error
    • Moved Listener to Even folder
    • Optimized chunk unloading method
    • NEED TO LET NEW PTWEAKS FOLDER LOAD
    [v1.9-0.6a]
    • Updated To 1.2.3-R0.1 Compatible
    • Fixed Util Color Class
    • ^Moved all Listeners to Main Class^
    • Re-Wrote Entity Listener
    • Re-Wrote Player Listener
    • Re-Wrote World Listener
    • Added GroupManager Support
    • Fixed Sync Save Times
    • Added New permissions
    • Changed Resource management
    • New Default settings
    • Fixed Duplication Bug with Output in Console
    • Fixed Mob limit not responding
    • Fix Mob Ratio not being correct
    [1.8]
    • Updated to bukkit 1.0.0-r
    • Chunk life time now 4 1/6 mins.
    • Removed all "i" interface from Threaded Save
    • Updated Ram to V1.2
    • Started Permissions for Ptweaks ptml
    • New Feature : TNT EDIT Changed from finished, to coming
    • More CPU friendly.
    • Updated Ram to v1.5
    [1.6.1]

    • Updated for bukkit build 1337
    [v1.6]
    • All features getWorld instead of getServer
    • Added New Feature "Ram"
    • Added New Command /ram
    • Added New permission ram.has
    • Auto Save stopper now slows down process's
    • Old code in PerformanceTweaks.java Updated
    • Fixed torches light not going out when broken
    [v1.5.1] Updated (10/5/11)
    • Fixed Remove animals being there twice
    • Fixed Ea, Enabling Mobs.
    • Fixed Ra, Disabling Mobs
    • Fixed Enable mobs not working
    • Fixed Plugin.yml to say correct version instead of 1.5
    • Fixed Enable Animals not working correctly
    • Thanks @pegasus for pointing out the RA being duped.
    [v1.5]
    • Chunks Mini-save is now a little slower, this takes up less CPU
    • Mob limit isn't only on Death and Spawn, but chunk load as well.
    • Fixed OnEnable and OnDisable leaving extra notes in console.
    • Updated for CB #1240
    [v1.3]
    • Fixed CPU taking up extra resources for no reason
    • Fixed Ptweaks error string
    [v1.2]
    • Added Ptweaks Version 1.2 (C-V)
    • Updated to work with CB: 1185



    Please leave feed back!
    If you find any bugs, Please let me know immediately!

     
    jo3la, DoomLord, RoiTortue and 8 others like this.
  2. Offline

    FuturaEX

    @Mrchasez i run 24 plugins on my server and sometimes it lags a bit, i don't know how much ram or mb or whatever it's using. but i have had server crashes sometimes, i guess it's becuase i run this on my laptop, but would this plugin reduse lag and make it run smooter ?
     
  3. Offline

    Mrchasez


    Yes, Of course
     
  4. Offline

    Fr0zenfr0g

    Love ptweaks and nolagg ;D
     
  5. Offline

    Cristof

    have u both on same server :D? Work fine without problem?
     
  6. Offline

    Fr0zenfr0g

    I did have nolagg untill some black holes and now ptweaks, i like nolagg a little bit more and that plugin does almost of wath this does and more but that plugine have some buggs...
    Now i dont know how to do but i think i will have only nolagg when some buggs is fixed...
     
  7. Offline

    gdea73

    Cool. Running quite a few plugins on my server, including Spout (helps with bandwidth) and this plugin (helps a lot with chunk loading). It runs effectively on 512MB of RAM which is good, because I'm using a Pentium 4 2.8, with 1GB of RAM, and previously I could only barely get by with 6-8 players ;)

    Actually one thing I was wondering. I have no lower RAM limit on my server, I use -Xincgc instead of -Xmx(RAM)M. logging on as the first player there was a bit of chat lag but the chunk loading was alright. I assume this is because when no one is online, the RAM usage plummets and has to "wake up", so to speak, when players join. (not a real issue, as it still performs better)
     
  8. Offline

    Mrchasez

    Like i said before, These two plugins do very different things.
    If you have lag issues, because of ram, Or you want better performance, going with Ptweaks is better.

    Glad to hear that :)
    Well, you really shouldn't see any chat lag from Ptweaks, however if the server just started, i can see that it might.

    Thank you :)

    They should work, I have not tested it though.
    The way they work is very different, so i do not think there would be a conflict.
    I will test this today.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  9. Offline

    bergerkiller

    Also, just before 'is very different' is the final say:
    - AutoSaveIntervalChanger idea taken over from performancetweaks, like you did, did improve it a bit to work for both 1060 and 1185, and to survive native field name changes without exceptions.

    - Chunk unload delay almost the same as performance tweaks, only difference is that I re-wrote it to make it a bit more versatile. (more things you can change internally)

    - Mob limiter of NoLagg completely different. Mine doesn't use a threshold, it actually limits it. It allows for world-specific, default and global limits, improving p(erformance)tweaks to fit more uses

    - I had to add a custom chunk sending implementation because the default chunkUnloadDelay of performancetweaks was causing black holes. Since you took it over, I hope you won't face the same.

    - NoLagg works at network usage limitations, ptweaks works at RAM usage limitations. CPU is just a side-product from limiting the network usage. Entities hardly increase RAM, chunks do.

    - The NoLagg chunk feature add-on is giving me a headache, don't use it yet. It works really well to some extent, but for some reason clients don't always receive the packets sent.

    - Here the previous method of NoLagg is used to limit TNT lag, but it's not a nice method. It works for tons of tnts, but when detonating <10 it looks ugly. (only one or two tnts actually explode). Also, this method spawns way too many TNT entities, causing lots of entity move update packets to be sent to clients. It may limit CPU, but won't limit network stress. This is why I decided to handle the entire explosion, instead of cancelling the event.
     
  10. Offline

    Mrchasez

    - All of the bugs from PerformanceTweaks were fixed here :)
    - We also do not get Beta holes like Nolagg, Because the way it is set up.
    - Like i previously said, TNT Edit of Ptweaks works a bit different then how Nolagg used to do it, more effective, The packets being sent are no longer an issue and unless using over 10k tnt will cause little to no lag.
    - Ptweaks gets data from surrounding chunks without using access memory, Nolagg gets information from chunks infront of the player, but cause's side chunks to load slower.
    - Having your ChunkDelay slows loading of chunks with it on, and uses more memory with it off.
    - Over all, Its just the players preference for which one they use, Or both.

    Thanks for your comment :)
    As of right now, the only thing Nolagg is doing more effective is the stacking method (which is really cool)
     
  11. Offline

    bergerkiller

    How do you mean? You mean you open your own stream in an Async thread to load data from chunks? Because that will lead to chunk corruption if you don't watch out. If your plugin, as I believe it now, removes chunk data from memory and replaced it with disk reading...then that's a VERY bad idea. My computer was crashing 4 times a day until I set the save interval higher. No more crashes. Imagine loading chunks from disk 24/7...the risk of my pc failing gets higher every time I do something else while I run the server...

    Also, that side-chunks load slower is invalid. The opposite is true: the front and side chunks load first, when all this is done the back chunks are loaded. It depends on the send interval used how fast chunks are loaded. I used an interval of 2 and it was incredibly smooth...but unfortunately I had to set it to 5 because of people complaining about missing chunks. (which never happens on my local server anymore, which leads me to believe it's a networking issue)

    Also, did you try out NoLagg tnt at all? I understand you cancel the explosion event, but this doesn't cancel all the mobile entities being spawned in the air. This is, besides the explosions, a major lag issue. It's almost the same as having 400 torches instantly spawning.

    But, since you don't upload the real version, I can't compare. Until I get to see the results of ptweaks (with resource manager at hand), I am not convinced it improves PerformanceTweaks.

    EDIT

    Also, I notice one key feature difference between NoLagg and performancetweaks for the unloadChunkDelay feature: this:
    Code:
                    Thread.sleep(mPruneTime);
                    Set keysS = mChunks.keySet();
                    Chunk keys[] = new Chunk[keysS.size()];
                    keysS.toArray(keys);
                    long lNow = (new Date()).getTime();
                    Chunk achunk[];
                    int j = (achunk = keys).length;
                    for(int i = 0; i < j; i++)
                    {
                        Chunk key = achunk[i];
                        long age = lNow - ((Long)mChunks.get(key)).longValue();
                        if(age >= (long)mLifeTime)
                        {
                            CraftWorld cWorld = (CraftWorld)key.getWorld();
                            net.minecraft.server.World mWorld = cWorld.getHandle();
                            ChunkProviderServer cp = (ChunkProviderServer)mWorld.chunkProvider;
                            if(!cp.unloadQueue.containsKey(key.getX(), key.getZ()))
                                cp.queueUnload(key.getX(), key.getZ());
                        }
                    }
    
                }
    I use world.unloadChunk(cx, cz), but here this unloading is queued. I didn't notice it in PerformanceTweaks before, but it could be the main reason why black holes appear.

    I can deal with ptweaks being for RAM and NoLagg for CPU and network usage, but I do want to prevent false promises being made to server admins. Chunks are kept in memory for a reason...
     
  12. Offline

    Mrchasez

    Such long posts you give D:
    Our plugins work almost the exact same way, Ptweaks has no bugs at the moment either.
    I am not trying to go to war with Nolagg. They are both good at what they do. I do not see what your trying to prove here. No false promise's will be here. PerformanceTweaks is not the exact same as Ptweaks btw either.
     
  13. Offline

    bergerkiller

    @Mrchasez Not going at war either, just warning you before making 'certain' mistakes. I'll sum it up:

    Cancelling tnt explosion event
    Profit: Less explosions, less block changes
    Loss: Lots of mobile TNT being swung into the air. Threshold around 30000. Can cause tnt to not fully detonate a stack, leaving behind a huge stack of TNT. (WorldGuard could do the same here)

    Changing 'load from memory' to 'load from disk'

    Profit: Less RAM usage
    Loss: Chunk corruption, block issues, slower, more CPU usage because of reading and writing, more disk usage

    The first point: meh, I don't really mind. But you should at least add limits for mobile TNT entities for it to work correctly.

    For the second point: If you don't use the disk method, then what do you do? You need to store chunks somewhere, else Bukkit can't change blocks.

    EDIT

    If it's not the same, then why do you offer a download link containing exactly the same coding as PerformanceTweaks...? Kinda misleading...
     
  14. Offline

    Mrchasez

    Your first point is correct, I said anything over 10k TNT will end up causing some lag. It stays in memory, not loading from disk. You're not get any Chunk corruption / Block issues / Slower, but Ptweaks takes some more CPU. If you wish to continue this convo PM me.

    Thats where your wrong.
    Again, This is really filling up the Ptweaks thread, If you wish to continue "arguing" PM me.

    Our argument has been resolved xD

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  15. Offline

    gameswereus

    I am adding this to my production server (which doesn't suffer from performance issues). I'll tell you how it goes.
     
  16. Offline

    Mrchasez

    Ok , Sure.
    Thanks
     
  17. Offline

    the_Zorro

    Well "Remove all server lag!" is not right, because I tested it and it didn't reduce lag at my point (Tested with MinecartMania).
    But advertisement has to work, right? :p
     
  18. Offline

    Mrchasez

    It removes all lag caused by ram and process's.
    If your running a server that can't handle it anyway, this wont help.
     
  19. Offline

    Marthaan

    Alright so if I am to install this, the overall load on the server will decrease?
    Sometimes we are suffering from lagspikes since we're running the server on a windows VPS.
    Assigned memory is 7GB. What settings do you recommend? The processor is a pretty powerful 4 core.
     
  20. Offline

    the_Zorro

    Well I don't even know where the lags comes from. That's why I just wanted to test this plugin.
    My CPU usage is about 15%, RAM is about 600 MB of 4 GB, the server runs with 20 TPS and it's localhost.
    Only thing that could be is that MinecartMania only uses one thread, so it only runs on one core of my CPU (12,5 % per core).
     
  21. Offline

    Mrchasez

    This would be perfect with Ptweaks.
    Your see a real improvement. Those lag spikes will most likely go away as well.

    Really don't know then.
    Ptweaks should still help in theory though.
    Even if it just loads chunks faster for you

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  22. Offline

    gameswereus

    I haven't tested the TnT feature yet, but everything else seems to be helping. My server us usually lag-free anyway, but none of my users have been complaining. I am running this with NoLagg.
     
  23. Offline

    Mrchasez

    Cool!
    Glad to hear that.
     
  24. Offline

    Fiddy_percent

    I have a server with horrid ram usage it starts off fine but just collects and collects ram as new players join and the ram doesn't go away even if there is only 1 person on :( will this help?
     
  25. Offline

    Mrchasez

    It will help, But if you have less then 300MB and a bad computer/ machine it can't do to much.
    If you have 300MB or more, this will do great :)
     
  26. Offline

    Fiddy_percent

    i have a server host and 3.6gb of ram lol I put it in and almost cried at how much it helped X) thanks a bunch!
     
  27. Offline

    mdskizy

    With this and nolagg both installed I was able to blow up 40200 tnt WITHOUT experiencing ANY lag of any sort. There was no chat lag and no can't keep up messages on the console. I think I'm gonna toss this on my actual server. 25 or so plugins with only 1.5gb's of ram with a max heap of 1024 could use some help. =) Thanks bud
     
  28. Offline

    Mrchasez

    That's great to hear!
    If you experience any issues running this and Nolagg please let us know.
    Thanks
     
  29. Offline

    Cristof

    Can u post ur NoLagg and Ptweaks config :D?
     
  30. Offline

    Fr0zenfr0g

    how do i set the minimum amount of mobs?
     
  31. Offline

    Marthaan

    Not sure why you want to do that or how you would think that would work?
    You can set maximum mobs in MonsterLimiter.prop

    Default it is max 2500 I believe and that is fine.
     

Share This Page