• Welcome to the new forums! Server IP: smp.hometownmc.com
Hello There, Guest! Login Register


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A simple-ish-hopefully-explanation of the different types of lag and why they happen
#1
So, we throw the word 'lag' around a lot to explain any type of latency or slowness between what you want to happen and when it actually happens

However there's quite a few different types and they often get mashed together, I thought it might be helpful to give a simple run-down of what they are, and what causes them- in a basic manner from a very non-professional.


[Frame lag]

This is the lag that you notice on your computer where your FPS drops dramatically- this is purely client-side (Client-side meaning, your end, not server end). 
FPS lag is caused by your computer not having enough resources available to render visuals at the speed you want it to- This is often caused by particles, item frames, large numbers of mobs- all things that constantly need updating on your computer and thus take a lot of processing power. 
If your computer has a lot of resources dedicated to this, you won't really notice much FPS lag in these situations, if it doesn't, often turning down particles and such helps a lot.

[Connection lag]

This one is pretty self-explanitory, internet isn't connected well enough to transfer the information to the server fast enough for you to get the responses in the time you want them. 
This is also a client-side issue

[TPS Lag]

Here we go boys and girls, the moment you've all been waiting for....

ok we're getting into server lag now- first off, TPS stands for 'ticks per second'

Ideally, there is 20 ticks for every irl second- a tick is used to determine redstone lengths, how fast the game checks for things, etc.

It's important to understand how servers work, versus single player- When you play on a server, all the calculating is done server end, aside from visuals. Basically you're shouting a bunch of numbers to someone in another room with a calculator- you've given the information (whatever you've done in game) but your computer hasn't had to figure out everything, all that info is sent packaged to your door. 
So, though you may not have lag client-side, things still affect the server that you may not realize. 

When the server's TPS is low, you start to notice things like block lag (when blocks re-appear after mining them), crops growing slower, animals growing slower, commands taking longer to process. 
This is because the server is processing more information than it can easily handle, so it has to take the time to process it all. 
Things that often affect TPS are things that require a lot of calculation on the server's part- redstone builds, large quantites of animals, etc.


{Redstone builds}

Redstone builds cause TPS issues because they require a lot of calculation- the server has to figure out if there's a block it's powering, what the power is doing, will a block be moving when something is powered, is there room for said block- etc.

The larger the build, the more calculations the server has to do- 
Hoppers constantly check for items that can be sucked into them (unless they have a container on top, thus why we ask hoppers be topped with droppers if possible), flying machines are a huge contributor because they work with slime blocks and constant updates, so the server has to figure out if there's the proper amount of blocks connected to the slime blocks that it can move, if there's room, etc- constantly, every time it moves. 

We also ask for lighting areas where redstone frequently is fired because the server has to calculate the light levels for mob spawning 

{Large quantities of animals}

        Now, I mentioned animals in the client-side lag because you can get lag from rendering all the animals- however, this is a different type of lag in this case. 
Animals and especially villagers have AI to calculate- sheep look for grass to eat, villagers - their workstations, beds, chatting with other villagers and exchanging information about players and dangers, monsters looking for things to aggro on, or running away from things (creepers from cats, tamed dogs). 
They constantly search for blocks to walk to, which direction to turn, things that make them seem more realistic. 
The server also has to figure out, if all these animals are bumping into each other, if so, how many times, is there too many, should they be dying due to entity cramming. 

So-having a bunch of animals in a close space causes a ton of calculations to need to be done on the server's part.

So again, though you may not see lag on your end because you have a good enough computer to handle the FPS lag, being near so many animals that are sending so many calculations to the server, causes the server to need to sort through all those.

Now, you may be able to handle these things in singleplayer fine, but when you have 40-50 people sending all these calculations to the server to sort through, the server can't possibly handle them at the speed in which we would like

[In Conclusion]

This is the reason for trying to limit the excess amounts of calculations- if you limit the things that cause MASSIVE amounts of info to be sent, then more people can send reasonable amounts, and there's less lag.
 
This has been a very non-professional explanation of lag

Thank you for coming to my ted talk
Unbelievable! You, Subject name here, must be the pride of Subject hometown here. -GLaDOS
 [Image: 3QynCgb.png] 
[Image: BbFygKt.png]
 
Reply
#2
Finally, thank you Illo for taking the time and explaining it in such nice simple terms. Now I don't feel so dumb. I never understood what all this Tps lag was about and often tried to ask questions about it but was basically left in the dark by others and treated like an idiot being left none the wiser and really feeling bullied. Your explanation of it now actually makes sense to me.
[Image: HwSS8L4.jpg]
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)