Server keeps crashing due to entities, can't find out why

So i'm running a minecraft 1.20.1 purpur server inside a docker container. The server was running well at first, but since this week i've seen alot of crashes due to a high entity count. I've used spark to create profiles, and it was showing 1800 loaded entities at time. When a certain player entered the game, the entity count nearly doubled (from 1000 to 1800). I can't however find out where these entities are coming from. When i'm present in the region of that player, the f3 menu only shows 60 entities being loaded. When i look in the regions using the spark viewer alot of random regions where no players are present are also loading entities. How is this possible? Server info - Purpur 1.20.1 build 2060 - Running inside itzg docker container - Shared VPS, we got 4 cores from the 64 cores. Hosting provider is Portainer - Sim distance: 10, view distance: 10 - Only 2-3 players online at the moments of crashing. No crazy farms or redstone contraptions have been built yet I've been trying to optimize this server for weeks now and at this point i'm completely clueless how i can fix this, so i'm reaching out to the community of people who definitely know more about optimization than me. Thank you in advance for helping me out
36 Replies
Admincraft Meta
Admincraft Meta17mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by dj_stinkynuts#0
Discount Milk
Discount Milk17mo ago
!logs
Carl-bot
Carl-bot17mo ago
Please check your server log for errors from your plugins.
If you need further help understanding the errors, please send us the whole log file. Where can I find the server log? Logs are stored in <server_directory>/logs/. Search for a file explorer in your server's management interface and navigate to that directory. Once you've opened that up, search for the latest.log file. Some providers have a separate page for logs and may hide the "logs" folder. On Aternos: • Go to https://aternos.org/log/. On Minehut and server.pro: • Go to the "files" tab in the left menu. • Navigate to the root directory of your server. • From there navigate to /logs/latest.log. What should I do with the log? • First of all, read it! I mean, that's what you do all the time when you run a server, isn't it? Try to locate any errors that have anything to do with the issue you are facing. • If you got the latest.log file or created a .txt file with the necessary errors you can upload these directly to the channel, but we prefer if you upload them to https://mclo.gs/. • If you have trouble downloading the log file, copy/paste the text to a paste service (like mclogs). Copy the link that it gives you and send it to us. (Don't worry, McLogs hides your users' IPs.)
Admincraft Canned Responses
Admincraft Meta
Admincraft Meta17mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
Requested by dj_stinkynuts#0
Jesper
JesperOP17mo ago
i'll look to get the other logs from around the time the crash happened but the weird thing is, the logs don't really show any errors. Except spark errors at the time the crashes occur
Admincraft Meta
Admincraft Meta17mo ago
We have uploaded your file to a paste service for better readability
Paste services are more mobile friendly and easier to read than just posting a file
2023-09-19-7.log
Requested by dj_stinkynuts#0
Discount Milk
Discount Milk17mo ago
Send the entire logs using mclo.gs please
Discount Milk
Discount Milk17mo ago
mclo.gs - Paste, share & analyse your Minecraft logs
Easily paste your Minecraft logs to share and analyse them.
Jesper
JesperOP17mo ago
So like all logs from the past few days or so?
Discount Milk
Discount Milk17mo ago
The log file you just tried to send, use mclo.gs
Jesper
JesperOP17mo ago
https://mclo.gs/f3k37GH this link was created by the discord bot
mclo.gs
Purpur 1.20.1 Server Log [#f3k37GH]
223 lines | 118 errors
Jesper
JesperOP17mo ago
Some info that i don't see back in the log: we are using Aikar's JVM flags. The server is also being run inside a docker container, using the docker image by itzg. The only plugin i've installed is CoreProtect, since spark already comes with purpur.
Discount Milk
Discount Milk17mo ago
I assume you didn't compare what the bot sent to what you sent Pretty sure the bot cut it short
Jesper
JesperOP17mo ago
i'll paste it in manually
Discount Milk
Discount Milk17mo ago
Thank you.
Jesper
JesperOP17mo ago
I deleted the message containing the original file due to privacy. I wasn't even aware that the server retrieves IP adresses and stores them in logs, thank you for making me aware of that
Jesper
JesperOP17mo ago
https://mclo.gs/92UGhlx here i pasted the log manually. Line count is the same though.
mclo.gs
Purpur 1.20.1 Server Log [#92UGhlx]
223 lines | 118 errors
Discount Milk
Discount Milk17mo ago
I'd prefer you to send the entire log file. Line 222 indicates that isn't the full logs.
Jesper
JesperOP17mo ago
https://mclo.gs/UIMkBvC these should be all the logs from the period the most crashes occured. this was the timeframe today where me and 2 friends where playing, no other players have been online today.
mclo.gs
Purpur 1.20.1 Server Log [#UIMkBvC]
355 lines | 55 errors
Discount Milk
Discount Milk17mo ago
I love 251-252 where it goes from a player disconnecting to a new log starting :upsidedown_tears:
Jesper
JesperOP17mo ago
The weird thing is, some console messages that are shown by the docker container are not saved in the logs. Those messages include:
[init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x. 13 1000 1000 4096 Sep 19 20:18 /data'

[init] Resolving type given PURPUR

[mc-image-helper] 20:26:26.550 INFO : Resolved Purpur version 1.20.1 build 2060

[mc-image-helper] 20:26:26.587 INFO : The file /data/purpur-1.20.1-2060.jar is already up to date

[init] Enabling whitelist functionality

[init] Setting mode

[init] Using Aikar's flags

[init] Setting initial memory to 4G and max to 4G

[init] Starting the Minecraft server...
[init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x. 13 1000 1000 4096 Sep 19 20:18 /data'

[init] Resolving type given PURPUR

[mc-image-helper] 20:26:26.550 INFO : Resolved Purpur version 1.20.1 build 2060

[mc-image-helper] 20:26:26.587 INFO : The file /data/purpur-1.20.1-2060.jar is already up to date

[init] Enabling whitelist functionality

[init] Setting mode

[init] Using Aikar's flags

[init] Setting initial memory to 4G and max to 4G

[init] Starting the Minecraft server...
023-09-19T20:42:14.646+0200 WARN mc-server-runner Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error. {"exitCode": -1}
023-09-19T20:42:14.646+0200 WARN mc-server-runner Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error. {"exitCode": -1}
Discount Milk
Discount Milk17mo ago
You mentioned a server crash but haven't sent the full log file that includes a crash :/
Jesper
JesperOP17mo ago
that was a point where either the server or docker itself crashed, as a result we got timed out. We didn't disconnect voluntarily Yeah but see that's the weird thing, i don't get any errors in the console. Could this be caused by the container itself crashing instead of the java process? Because we all get disconnected, the logs get cut off and only the message "minecraft server failed" is sent in the console by the docker image. After that the container automatically reboots itself
Jesper
JesperOP17mo ago
https://github.com/itzg/docker-minecraft-server This is the image we are using, in case you are curious.
GitHub
GitHub - itzg/docker-minecraft-server: Docker image that provides a...
Docker image that provides a Minecraft Server that will automatically download selected version at startup - GitHub - itzg/docker-minecraft-server: Docker image that provides a Minecraft Server tha...
Jesper
JesperOP17mo ago
the spark profile (which i don't have anymore) showed a big rise in entities, tile entities and therefor MSTP right before this occured. Entity count was about 1600, tile entities about 6000. Only two players were actually loading stuff i think, i was in spectator mode. Memory usage was about 1.5gb, we set the heap size to 4 in the jvm flags. the vps has 8gb available, so we provide a buffer for the server. Around those two players were not really any entities i could think of. Debug screen (f3) also showed around 60-120 entities being loaded. What both players did however have are really large crop fields. All the spawn chunks are basically one giant wheat field. The other player lives around 3000 blocks from spawn, but also had alot of melon fields. Could these cause any lag, perhaps the server randomly ticking the crops?
Discount Milk
Discount Milk17mo ago
How much memory are you assigning to the container
Jesper
JesperOP17mo ago
We haven't set any limitations on the container
Discount Milk
Discount Milk17mo ago
Check your system logs to see if you're being oomk'd Not server logs, the actual VPS logs.
Jesper
JesperOP17mo ago
This is from spark. I see that the server jar (process) is only using 740mb now, which makes sense, since no one is online. However the physical memory, which i assume is the vps, is almost full. So that probably causes the container to run out of memory i assume?
No description
Discount Milk
Discount Milk17mo ago
Yeah, that's why I'm telling you to check your OS logs for out of memory killer Should be in /var/log/ named syslog I think Based on OS ofc
Jesper
JesperOP17mo ago
I'll check Yeah the folder exists, there is no file in there named syslog though. Running alma linux We just disabled all other containers on the VPS, only running the minecraft container right now. Using 5.6gb of memory on the vps.
Jesper
JesperOP17mo ago
These are all the threads ran by purpur. They all use the same startup command, which has the 4gb memory limit. Does this mean that every thread now has a limit of 4gb, instead of all the threads together? Cause clearly all threads together are using more than 4gb of memory
No description
ProGamingDk
ProGamingDk17mo ago
jvm overhead will use more than the xmx
Jesper
JesperOP17mo ago
Already got it by now yeah We forgot the overhead room So yeah, we were just running out of memory on the VPS. XMX memory wasn't filled, but there was not enough overhead. We solved the issue now and server runs fine. This post can be locked / closed. Thank you all for your help!
Discount Milk
Discount Milk17mo ago
!close
Admincraft Meta
Admincraft Meta17mo ago
post closed!
The post/thread has been closed!
Requested by discount_milk#0

Did you find this page helpful?