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
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
!logs
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
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
message.txt
Requested by dj_stinkynuts#0
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
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
Send the entire logs using mclo.gs please
mclo.gs - Paste, share & analyse your Minecraft logs
Easily paste your Minecraft logs to share and analyse them.
So like all logs from the past few days or so?
The log file you just tried to send, use mclo.gs
https://mclo.gs/f3k37GH this link was created by the discord bot
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.
I assume you didn't compare what the bot sent to what you sent
Pretty sure the bot cut it short
i'll paste it in manually
Thank you.
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
https://mclo.gs/92UGhlx here i pasted the log manually. Line count is the same though.
I'd prefer you to send the entire log file.
Line 222 indicates that isn't the full logs.
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.
I love 251-252 where it goes from a player disconnecting to a new log starting :upsidedown_tears:
The weird thing is, some console messages that are shown by the docker container are not saved in the logs. Those messages include:
You mentioned a server crash but haven't sent the full log file that includes a crash :/
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
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...
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?
How much memory are you assigning to the container
We haven't set any limitations on the container
Check your system logs to see if you're being oomk'd
Not server logs, the actual VPS logs.
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?
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 ofcI'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.
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
jvm overhead
will use more than the xmx
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!
!close
post closed!
The post/thread has been closed!
Requested by discount_milk#0