EnigmaticaModpacks / Enigmatica2

The official repository and issue-tracker for Enigmatica 2
https://www.curseforge.com/minecraft/modpacks/enigmatica2
32 stars 23 forks source link

Constant “Can’t keep up” and “Fetching addPacket for removed entity” messages in server console and major tick lag when generating chunks #391

Closed Dimentive closed 5 years ago

Dimentive commented 5 years ago

Modpack version 1.62

Can the issue be reproduced? Unknown

Issue I am getting constant messages like this in my server console: [23:33:30] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 2772ms behind, skipping 55 tick(s) and [23:33:59] [Server thread/WARN] [minecraft/EntityTrackerEntry]: Fetching addPacket for removed entity

These are probably unrelated, but I decided to make one issue rather than two separate ones.

I’m playing on a local server with a friend. These messages still show up when I’m playing on the server alone. I usually don’t have any TPS lag: my mean tick time is 15–29 ms (sometimes upwards of 40, but I’ve never seen it pass 50), and my mean TPS always seems to be 20, which is also good. I don’t know if I should be worried about these messages, but I’d still like to get rid of them.

I’ve been told that these messages can be related to mob farms and such, but my world has no mob farms or even any automation, as we’re still pretty early in the pack. They also happen when we’re just at home, not just when we’re generating chunks.

I used to have 4 GB of RAM allocated to the server, but I’ve raised it to 6 GB, which didn’t get rid of these messages.

NielsPilgaard commented 5 years ago

As long as your TPS is 20, everything is peachy :) You will, as I've said before, not get the best performance when you have client and server on the same PC, you're limited by your CPU.

The addPacket message doesn't seem familiar though, may I have the server's latest.log?

Dimentive commented 5 years ago

latest.log

NielsPilgaard commented 5 years ago

Alright, that appears harmless as well :)

Dimentive commented 5 years ago

That’s good to hear. Do you know why it’s constantly appearing in the log, though?

NielsPilgaard commented 5 years ago

I'm afraid not, it may have something to do with RandomPatches removing entities with duplicate IDs.

Dimentive commented 5 years ago

All right, thanks.

I’m glad I don’t have to worry about it.

Dimentive commented 5 years ago

Unfortunately, my locally hosted server’s tick time and TPS aren’t so great when I’m playing my friend, especially when I’m generating new chunks. My tick time and TPS were only good when I was playing on the server alone. I assume that the “Can’t keep up” and “Fetching addPacket for removed entity” messages that constantly appear in the console are related to this, but I’m not sure about that.

When neither of us is generating new chunks, the mean time is usually around 40–50 ms (sometimes upwards of 60 ms) and the TPS usually 15–19 (although sometimes 20). This isn’t ideal, but it’s also not that noticeable, as it doesn’t cause much block or entity lag. However, when generating new chunks, the mean tick time can be as bad as 170–285 ms, and the TPS can be as bad as 4–5. This causes some major rubberbanding and lag, making the game quite unplayable when either of us is generating new chunks. As mentioned, it’s mostly fine when we’re in the chunks that we’ve already loaded, but exploring the world becomes quite tricky with such lag.

I have 7.1 GB allocated to my client, the server has 6 GB (I tried lowering it to 5 GB, but that did nothing), and my friend has 6.7 GB allocated to his client.

Since my tick time and TPS were fine when I was playing on the server alone, do you think it could be related to my friend’s connection?

Do you know if there’s anything that we can do to improve the TPS speed? We’re still pretty early–mid-game, so we don’t have much automation or machinery going on yet. My friend has chunk-loaded a part of a village, and I’ve chunk-loaded a furnace, a crusher, and some other basic machinery, and that’s about as far as the loaded chunks go.

These are the Java arguments that we both use currently: -XX:+UseG1GC -Xmx4G -Xms4G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M

NielsPilgaard commented 5 years ago

You should pregen the world.

Dimentive commented 5 years ago

Also, I should mention that after standing still in the newly generated terrain for 20 minutes, and even disconnecting and re-entering the server, I was still getting bad tick lag.

I’m also having another problem where items are completely disappearing when dropping them. This happened when I had been generating new terrain, but when I was in base, I could drop items (Q) just fine. Do you think this could be due to the tick lag? It also happened to my friend.

I know that there are plenty of saplings, wood logs, and other things that haven’t been picked up, lying across the world, but surely, they won’t cause tick lag or items to disappear when they’re in unloaded chunks, right? I mean, them being in unloaded chunks in the first place is why they haven’t disappeared. In case it is causing lag, is there a Forge command I could use to clear all the drops in the world?

Anyway, as for pre-generating, I haven’t done it as I’ve read that it takes up a lot of hard drive space. Someone also said that it only fixes the lag you experienced while you’re generating new terrain, and as mentioned, I’m experiencing lag in newly generated terrain 20 minutes after I generated it, so would pre-generating actually fix it?

Dimentive commented 5 years ago

Anyway, I’ll try Chunk-Pregenerator. Does it work well for a world that isn’t brand new?

NielsPilgaard commented 5 years ago

I do not know what causes the disappearing items bug. Yes Chunk Pregenerator works just fine with worlds that aren't brand new.

Dimentive commented 5 years ago

All right, thanks.

I started chunk-pregenerating, and I got a few of armour stand-related errors that seem to be from the generation of Recurrent Complex structures:

[20:13:57] [Server thread/WARN] [minecraft/EntityList]: Skipping Entity with id minecraft:armorstand
[20:04:18] [Server thread/ERROR] [reccomplex]: Error loading entity with ID 'ArmorStand'

I’ve reported them on the Recurrent Complex issue tracker.

Dimentive commented 5 years ago

I pregenerated lots of chunks near me, and we’re still having really bad TPS, even when I’m not loading, let alone generating, any chunks. 😕

NielsPilgaard commented 5 years ago

Have you tried restarting the server? The issue tracker is for tracking issues/bugs fyi, not for general support.

Dimentive commented 5 years ago

Yeah, restarting doesn’t help. I only have the server running when we’re playing.

I’m trying to cut down some trees, and this is what I’m getting in the server console: https://pastebin.com/raw/z2RgbcmH

Anyway, sorry for asking for support here. I forget that issue trackers are just for tracking bugs, crashes, etc. I’ll just stick with asking for help on Reddit and Discord.