Jump to content

Controlling lag or finding its source?


Recommended Posts


I'm opening a server soon (advertising) but first I want to pick out whatever problems I might run into in the hopefully-not-near future.

Having had the server open to my old players from my last server only, I've run into a slight problem with lag. Most of this is due to factories, and no amount of "text warned control" (putting warnings in spawn, having rules over the control of factories) has helped at all.

I'm not very good with computers, but I've upgraded my RAM to 16GB, 13 for the server, and this problem has been lessoned, but not stopped. Do I have to restrict factories to the point of no return, or is there another method of control?

A plugin I have (tekkitrestrict) has a minimum for timers, but that does not help with transport pipes and engines, and it would also annoy players. My aim for the server is to have few banned items, excluding the exploit/bugged items. Any suggestions for that?

I expect sometime while I have the server open that people would *try* to annoy me by placing a bunch of .2s timers and lagging it extremely.

If this were to happen, is there a method to find the lag-source and stop it? Or do I have to rely on the lagged chunk or server logs of the use of wrenches to find it?

Any advice, or other things I should look out for would be greatly appreciated.




How do I stop people from building lagful factories, and how would I locate the lag source if necessary?

Link to comment
Share on other sites

Teach people about loops, how to avoid them, and the impact they have on the server.

Your "LAG" issues are far more likely to come from CPU or I/O bottlenecking, than a lack of RAM, there are plenty of servers that have 16-32GB of RAM 50 players and <5TPS.

Make sure you have a good staff team who know about this stuff (if they dont, teach them) and get them to look out for things like large collector arrays, duped items (having 200+ HV solar arrays is a pretty good sign someone is duping or using creative mode to get items. (In reality 10 HV Solar is all most players will be bothered to actually make, and is all you actually need to provide enough power for whatever crazy scheme you have planned) (If you can't achieve what you want with over 102,000EU a second... chances are your probably doing it wrong ;-) )

Teach users about painting cables, wires and tubes to avoid looping EU, RedPower, Items etc... while still maintaining a compact setup.

To put what I am saying in perspective:

I actively enforced this by regularly logging into my servers and checking for this sort of thing, teaching users about how to create their dream setups without lagging out the server by doing exactly what I just said. I went to my Girlfriends for Christmas, and checked back in today. Here is the comparison for one of them:

I left on the 10th of December. - Server TPS: 19-20, Online players: 18-20

I checked in today (26th December) - Server TPS: 6-10, Online players: 11-16

Link to comment
Share on other sites



He means that signature. I don't get why its so bad but whatever.

I find almost all my lag comes from players themselves not knowing enough about tekkit mods.

For example. Factories made from buildcraft pipes are so dreadful. They almost always over flow and leak entities which mass amount will cause lag. Or a quarry leading to a single chest that overflows. These are honestly the only sources of any lag on my home hosted server. Any time I see lag I do /lag and if it isnt sitting at 20TPS I run /remove items. That will delete any entities in your world. I also depend on a plugin called Clear Lagg to run that command every 10 minutes.

Link to comment
Share on other sites

I also depend on a plugin called Clear Lagg to run that command every 10 minutes.

Unfortunately ClearLagg doesnt clear out the items stuck in Buildcraft pipes.

But most importantly, most vanilla items do not have a thing called a "TileEntity". Most you would normally find in a vanilla player's chunk is about 500. However, with Tekkit, we are looking to about max 65,536 TileEntities per chunk. This is because "most" tekkit items, such as lamps, microblocks, ect. All use TileEntities. Why is this important? Because you may have about 1000 chunks loaded, but each loaded chunk has to loop through around 200-65,536 TileEntities. This goes for a grand-total of 200,000 - 65,536,000 TileEntities that are being looped through. Normally when the server loops through the chunks, it sort of ignores most blocks and modifications, but with Tekkit... not so much. After all, 16x16x256 = 65536 Total Blocks that may be placed. However, this, my friends, is passive lag and you cannot do much about it. Most items in Tekkit, including Mk3s, Lamps, RedPower Circuits, HV Solar panels and RP Computers cause about the same amount of lag. (maybe 5 nanoseconds each per tick, building up in lag over time)

There are also things like certain plugins and mods that cause active lag on your server. For Example, Chunk loaders. When you decide that you Reeeeally want to stop griefers and get that awesome anti-grief plugin... Guess what? lag! Plugins such as CoreProtect happen to log every single action that may take place, which can cause quite a lot of lag if you have a lot of players and buildcraft. Yes, thats right, CoreProtect also logs every single action that Quarries do.

But, there are some steps that you can take to get rid of Active lag! First, Ban Chunk Loaders. Second, Get the EEPatch2 alongside GriefPrevention to make sure that your players are close to impossible to grief and they cant dupe as easily. Third, remove any other plugin such as CoreProtect and HawkEye that logs pretty much everything... Or set them to minimal modes.

There is also computercraft which causes passive lag that you can fix! Unfortunately, I lost the link to patch it, but I will try getting a pastie of the modifications required for this. This passive lag can actually bring your tps to about 3.2 if you do not patch it.

Redstone computerCraft 3.2-Tps fix

Here is a list of plugins that I know for a fact that really lag your server with Tekkit:

  • MyHungerGames (!!! Watch out!)
  • CoreProtect
  • PopulationDensity
  • HawkEye (!!! Watch out!)
  • LWC (If you use buffering, supercaching, and mysql which is a no-no)

I have been working on a massive modification of the Spigot.jar that has mcpc included for 1.2.5 and it has been o-k so far in reducing lag. At the cost of increasing the usage of CPU signifigantly. It is the multi-thread modification for Tekkit and man... it is a doosy. One simple idea requires at least 500-1000 hours of work to complete. But basically, what it does is split the server tick thread up into multiple sections and ticks for each section (about 30-60 sections) on a synchronized timer. This does go over the main issue of looping through 65,000,000 TileEntities. It also makes sure that players are always connected even if there are massive amounts of lag.Unfortunately, nobody has supported me in my quest to make Tekkit... and Minecraft in general, faster.

Developer of The Plugin TekkitRestrict v1.13 and EEToolPatch v2.22

Link to comment
Share on other sites

Unfortunately ClearLagg doesnt clear out the items stuck in Buildcraft pipes.

Not sure if you mean items moving through the pipes or at the spill point, but mine always removes everything not inside a pipe. Sometimes the image of the spilled items remain while the TPS comes back up but the disappear eventually.

Link to comment
Share on other sites

Not sure if you mean items moving through the pipes or at the spill point, but mine always removes everything not inside a pipe. Sometimes the image of the spilled items remain while the TPS comes back up but the disappear eventually.

When you place a loop inside a pipe, you can hold an (infinite # of entities) depending on the capacity of the server. This, in turn, will lag your server no matter what you do as an admin. These entities do not go away, even when a player logs off and will load when a player goes back on to the map. RP prevents this.

BC Loop pipe:

Quarry = Q

Pipe = P

Iron Pipe = O

Air = %

Quarry loads items into the pipes




The items that go into this loop will last forever and will not go back because of the Iron pipe connected to the quarry. This will eventually lag your server so much that it will get about 1tps.

(Please note that if players do this, they will probably hide it... and some players can do this unintentionally)

I may actually patch this in TekkitRestrict when/if I get the time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...