LaggRemover and AlwaysOnline

Search these up and these plugins are amazing. I thing sponge needs laggremover because it reduces ram consumption and AlwaysOnline is an amazing login plugin. To me by far the best there is. These plugins are good to just have at all times. Can someone make a ported version or a modified better version with improvements?

How often are you actually having troubles with the Mojang authentication servers? Ever since they got serious about it’s hosting I’ve not had any trouble connecting? It may be due to using Minecraft specific shared hosting without a dedicated IP address that causes the Mojang servers to blacklist your IP address temporarily.

LaggRemover…

gc…

Ok, so decompiling the source, they have a gc command which manually triggers the garbage collector, and tells you it’s freed ram, ok, sure, but that’s just caused the garbage collection to be called earlier then needed, and given you a false sense of security since objects are just going to build right back up again anyway. http://stackoverflow.com/questions/2414105/why-is-it-bad-practice-to-call-system-gc

clear items…

Ok, so in an attempt to reduce lag you clear items on the ground, sounds good in theory, in practice it annoys the crap out of your players. A better fix would either be to change the amount of time items live for, change the amount of time items tick for or change their merge behaviour, or if in creative and not required for redstone disable drops altogether.

It can sometimes make sense if you have modded containers breaking and spilling everywhere or players purposely creating machines to drop items, but that is more of a human problem / a relic from before items used to merge into stacks on the ground.

clearing entities…

Clearing all entities all at once is a drastic move and should only really be done as a last resort, 1. they are going to spawn back eventually, 2. if animals players will just breed them to stupid levels again, 3. if mob farms / singularities just track the amount of entities that are colliding, or disable collision once they hit a certain amount in a single tick.

It also potentially ruins minecart / armor stands / item frames.

if ((!e.getType().equals(EntityType.PLAYER)) && (!e.getType().equals(EntityType.ITEM_FRAME)) && (!e.getType().equals(EntityType.SPLASH_POTION)) && (!e.getType().equals(EntityType.THROWN_EXP_BOTTLE)) && (!e.getType().equals(EntityType.LEASH_HITCH)) && (!e.getType().equals(EntityType.MINECART)) && (!e.getType().equals(EntityType.MINECART_CHEST)) && (!e.getType().equals(EntityType.MINECART_COMMAND)) && (!e.getType().equals(EntityType.MINECART_FURNACE)) && (!e.getType().equals(EntityType.MINECART_HOPPER)) && (!e.getType().equals(EntityType.MINECART_MOB_SPAWNER)) && (!e.getType().equals(EntityType.MINECART_TNT)) && (!e.hasMetadata("NPC"))) {
              e.remove();

Yeah… Great code…

A better thing to do would be to check the amount of nearby peaceful mobs before breeding, if there are too many tell nearby players and prevent the animal breeding.

unloading chunks in worlds…

Configure your multiworld plugins correctly so that they don’t have chunks loaded in worlds that don’t have players or chunk loaders.

SmartLagAIDetector?

Runs on chat async thread, does manipulation of entities… naughty.

Allows players to scream “lag” in chat on low tps and have all monsters removed nearby if there are over 50 entities nearby? that’s not abusable…

has a thin npc’s mode, ok sure, cancels spawn events… which then make more block checks and spawns more mobs up to cap… dumb.

Contains an automatic update downloader… At least it’s the official one by gravity and looks to the curse API, but we all know curses recent track history with catching malware…

TLDR; Most anti-lag plugins are bullshit, and cause more lag in the long run. Either patch it at the server level or use mods/plugins/mixins that prevent the lag in the first place rather then “removing” lag as it happens.

If you need a tool to deal with a world with glitched out entities there are better options.

2 Likes

Well would you care to provide some of those options? Not everyone is as code savvy as you :stuck_out_tongue:

You mean specifically glitched out entities? MCEdit. It really shouldn’t need an online editor for something that might only occur once a year due to a bug introduced.

With mods that constantly update, such as pixelmon, glitches are bound to happen. MCEdit isn’t really something viable seeming as world saves become bigger with chunks being generated and those entities being saved into the world files.

And I meant an alternative to these lagg remover plugins.

He has already given several alternatives to lagg-remover plugins – its called thinking about the problem, tuning your settings, etc. Although having some ‘worse-case’ scenario commands available to use ie to wipe all the entities on command, rather than automatically would be appropriate as a fallback. But realistically,the various configurations in the default forge/spongevanilla settings can be used to reduce numerous types of lag and prevent entity related issues…

Preventing the lag instead of ‘cleaning up’ after it is the best approach, which the anti-lag plugins dont actually really do in most cases. Automagical clumping of dropped items - instead of 64 entities for a stack of blocks, only one is generated, and as more are dropped in the same space, they magnetically collect together keeps combining them in pairs and quads, so anyone who just keeps dropping and dumping is no longer able to entity-spam a region intentionally with burst-dropping grief. Unless they go out of their way by moving and dropping them into a trench as they walk along and keep them all spaced out far enough within a local area, which takes a fair bit of effort – and even so, rather than having a plugin that wipes everyone on the server as a lag-solution, what you want is a plugin that will let you say “whoa, there are n thousands of entities within a radius of x for player ABC” and let you investigate the region player ABC is in – if its an issue involving intentional lag-griefing, true tools willl let you then erase those entities within that small confines only, and you can eliminate the player issue.

It should be possible for plugins to , instead of triggering a threshold of “too many entities beyond x count, wipe-them-out!” to use that same trigger to say "Count the entities within a radius of r for each online player, and report/log the user and count at least; if the count > n then double-highlight the player(s) involved. The server may be impacted by someone’s massive farm, but the entire server isn’t at that farm, but someone is close enough to where its all going crazy

Want a better anti-lag plugin to deal with players who keep breeding sheep until there are 300 of them all inside of a 5x5 pen? Or chicken-making machines that harvest all the eggs, auto-dropper them into new chickens, to make more eggs, that infinitely generate chickens within a small spot – instead of punishing everyone on the server by erasing everything at intervals when those re-seeded farms work out of control, plugins should focus on DENYING spawnable things when there are already >n of them within a given radius. Will that solve every problem - no, someone will always come up with a system that lets them breed the sheep in one spot, then have them fall into a 5x5 pen again, or spam the egg machine in one spot, and have the chickens drop down away from it, have the eggs delivered to the machine further away from where the bin collection is - but even so – eggs dropped from chickens can itself be regulated instead - dont spawn an egg if there are >n chickens within a given radius or n eggs within a radius. When the numbers are low, its not a problem anyways, its only when you start getting hundreds of eggs drifting to a machine, or so-many chickens all in one machine, where lag issues start.

So this is where you need to think about how to deal with it - prevention - rather than aggressive wipe-outs. Let folks complain that they can’t walk away from their computer for 10 mins while their mobspawner cube machine pops out hundreds of mobs to kill all at once by limiting the amount of mobs that can spawn from a cube until they are destroyed.

Think of those types of things that can result in entity-pileups : drops, mobs, eggs, farm-instaharvesters - and see how many of them can be diminshed by the various settings available to the server already for throttling or limiting spawn conditions, altering alive-times, etc. Think about all the other cases, and make plugin requests for addressing those specifics (in terms of prevent-in-this-case)… I found on my server years ago, that spawner-cube farms were being used by folks to build up as many mobs as possible while a player walked away from a computer to get some lunch, etc – so with only a few lines of code, I had a system that noticed the uuid of the entity spawned and stored that in a set for the cube spawner location, unless the set already had 12 entries, in which case it denied the spawn. When a mob was killed, it removed the uuid from whichever set it was in. Bam, simple directly-targetted approach, prevented the building up of massive piles of entities waiting for players to kill hundreds at one time with a splash potion and derp the server out – impaired only the player whose plan was to max out the spawn limit in the chunks /server before using a splash potion.

With sponge coding and cause-tracking, this approach is even more efficient to impliment those few lines to target this problem. That approach addresses only spawning events, and cancels them if needed, preventing the buildup to then do an “elaborate counting” later. Similar approaches could be done for other systems, and those would be non-intrusive for all the other players on the server, yet impact players who intend to screw with your server with megafarms. You establish a rule that is enforced by the server itself to prevent issues – “Im not allowing more than 18 mobs to spawn from a given cube until some are killed” I’m not allowing breeded animals to spawn if there are >30 of them within a +/- 10 block cube of the person.

Again, with sponge, this is even more efficient than saying “within a given radius” by assuming a sheep farm etc will likely be flat, pens will be mostly flat, and no point in checking ± 20 blocks vertically when only +/- 3 vertically will work fine, and its easy to define a cuboid region to get the entity-list within it - if spawning=breeding where within cuboid region where cuboid region > 50 spawned-entity exist, deny spawn event. Solved: Preventing overpopulation within a small region – doesn’t impact someone from having a huge farm with 300 sheep spaced out, but it does prevent insane breeding where the breeding space is very dense, which is where lag issues come from - not from the 300 sheep spread out over a 40x40 block area, but from 50 sheep contained within a 10x10 area already becoming 300 sheep in that 10x10 area…
Very small, targetted limitation solution, not impacting people with large-area spaced out things, but highly non-intrusive by only checking a small area rather than a more intensive “check a +/- 150x150x10 cuboid and if its >300 sheep, deny”

Prevent the smaller, targetted entity-creation processes that result in high density/high counts and you prevent reaching high counts to trigger generic “p*ss everyone off all at once” responses. What gets past those targetted solutions specifically addressing cases like this, or genrically covered by server spawn control limitations, will be fairly rare, and best to have generic tools that let you discover why - why did the server trip off with suddenly having >n entities, rather than “well, it did, so i erased them” (like, what was the count for each entity-type serverwide, what was the entity-count within a 32x32x16 cuboid around each online player on demand or at a given checktime, and to use this information to identify that player Bob has 440 of the 520 chickens on the server within his cuboid as being the ah-hah. Identify, find a way to regulate, request a plugin to address the type of farming scenario that he managed to do, etc - cause otherwise, you wipe all the entities with no information, and you’re clueless. Bob then takes a few mins to get things setup again, and 30 mins later, he’s built it back up again to insane levels and it triggers a repeat again… Clueless a second time why, but at least you prevented lag aggrevation by deleting the dropped super-duper enchanted tools and such that player Joe was just 2 blocks away from making it back to pick up after dying a moment ago… Joe would have been happy with a few mins of lag by comparison.

Bottom line is there are many better ways to specifically address, limit, prevent issues, many can be done with internal control systems, and the rest via specific targetted solutions - and those may require plugins that dont exist, or have a ‘generic solution’ approach that could be applied (ie, deny spawning x type entity if >n x type entities within a radius r for any ANY situation - would end up preventing 70% of a super-crop harvest from being formed rather than giving everyone an n-second heads up to try to collect as much of that superharvest as possible before 85% of it gets wiped out by the drop clear. If the bigger generic such issue works for you and some plugin is doing that, excellent. If you can think of ways to code several very smaller targetted approaches that may check a radius of 8 for one case, a radius of 12 for another, or a cuboid that is only a few blocks tall but larger, those will be much much more efficient than a generically larger cover-all, and you can code those or request some very specific plugin request ideas that target such scenarios.

But brain power is needed, to think in advance, to minimize in advance, as much as possible, and where not possible, for focusing on having tools/commands that will let you assess situations – a command that logs the entitytype-count on demand ("hmm, 134 sheep, 153 cows, 174 chickens, 23 wolves, 496 pigs… " “312 spiders, 175 cavespider, 840 skeleton, 290 creepers…” in those cases, one of those entity count/types stands out as disproportionate. Check 2: Whats around each player - player bob has 340 skeletons within 50 blocks of him, smells like a big farm scenario…) Use those when folks go “hmm, lagging ??” Or schedule and alert when numbers are wonky, discover the causes, determine if it was malicuous intended and a rare thing, deal with the player, deal with the area (remove drops /entities within a smaller radius), and request/code a change when you identify a new, denyable approach that could have prevented it…

3 Likes