Closed WaterKnight1998 closed 4 years ago
I have tried using docker run -d -p 25565:25565 --name minecraft_server -v /minecraftServer:/data -e VERSION=1.14.3 -e EULA=TRUE -e ONLINE_MODE=FALSE -e OVERRIDE_SERVER_PROPERTIES=true -e ALLOW_NETHER=true itzg/minecraft-server:rpi3
and getting OLD message too.
Can you grab and provide some of the startup logs?
TBH, I have been disappointed with running Minecraft servers on raspberry pi ...it’s just a bit too underpowered.
Actually, stay tuned...it looks like the "rpi3" image tag is still using the wrong processor architecture. I'm going to do a build on my raspberrypi 3 and push that.
I pushed a new image and I see that it is correctly downloading 1.15.2 however, it's been stuck on the last command shown here for about 5 minutes now:
pi@rpi3:~ $ uname -a
Linux rpi3 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
pi@rpi3:~ $ docker run -it --rm -e EULA=TRUE itzg/minecraft-server:rpi3
Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx 2 1000 1000 4096 Feb 1 19:32 /data'
Checking version information.
Checking type information.
Downloading minecraft_server.1.15.2.jar ...
Creating server.properties in /data/server.properties
Setting server-name to 'Dedicated Server' in /data/server.properties
Setting server-port to '25565' in /data/server.properties
Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
Skip setting allow-nether
Skip setting announce-player-achievements
Skip setting enable-command-block
Skip setting spawn-animals
Skip setting spawn-monsters
Skip setting spawn-npcs
Skip setting spawn-protection
Skip setting generate-structures
Skip setting view-distance
Skip setting hardcore
Skip setting snooper-enabled
Skip setting max-build-height
Skip setting force-gamemode
Skip setting max-tick-time
Skip setting enable-query
Skip setting query.port
Setting enable-rcon to 'true' in /data/server.properties
Setting rcon.password to 'minecraft' in /data/server.properties
Setting rcon.port to '25575' in /data/server.properties
Skip setting max-players
Skip setting max-world-size
Setting level-name to 'world' in /data/server.properties
Skip setting level-seed
Setting pvp to 'true' in /data/server.properties
Skip setting generator-settings
Setting online-mode to 'true' in /data/server.properties
Skip setting allow-flight
Setting level-type to 'DEFAULT' in /data/server.properties
Skip setting resource-pack
Skip setting resource-pack-sha1
Setting difficulty to '1' in /data/server.properties
Checking for JSON files.
Copying any mods over...
Setting initial memory to 1G and max to 1G
Starting the Minecraft server...
OpenJDK Zero VM warning: G1 GC is disabled in this release.
Thank you, very much. I will give it a try now.
I think the Minecraft server crashed my whole RaspberryPi :( I left it alone to startup all the way and later wasn't able to SSH back into the rpi. Pulling the power cable and restarting fixed that :)
I'm finding this "old" issue too while running in kubernetes on a pi4 4GB node behind mc-router. I've run both the rpi3 tag and the multiarch:armv7 tag both with the same problem.
@0xVox can you provide container startup logs?
@0xVox can you provide container startup logs?
Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 7 1000 1000 4096 Mar 24 14:44 /data'
Checking version information.
Checking type information.
server.properties already created, skipping
Checking for JSON files.
Copying any mods over...
Setting initial memory to 1G and max to 1G
Starting the Minecraft server...
OpenJDK Zero VM warning: G1 GC is disabled in this release.
[14:46:51] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[14:46:51] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[14:46:51] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[14:46:51] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[14:46:51] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[14:46:51] [Server thread/INFO]: Starting minecraft server version 1.15.2
[14:46:51] [Server thread/INFO]: Loading properties
[14:46:51] [Server thread/INFO]: Default game type: SURVIVAL
[14:46:51] [Server thread/INFO]: Generating keypair
[14:47:02] [Server thread/INFO]: Starting Minecraft server on *:25565
[14:47:03] [Server thread/INFO]: Using default channel type
[14:47:03] [Server thread/INFO]: Preparing level "world"
[14:47:06] [Server thread/INFO]: Found new data pack vanilla, loading it automatically
[14:47:06] [Server thread/INFO]: Reloading ResourceManager: Default
[14:47:52] [User Authenticator #1/INFO]: UUID of player Goyface is 08a01e01-a8ce-49c0-b789-118e2b642237
You can see the server in the server browser - it will say "old" and when you try to connect it will hang at the "Encryption" stage (And the server will produce the auth log you see on the last line above) but will time out shortly after.
There is a few minutes between the G1 GC warning and the timestamped logs.
Oops, since it didn't think it needed to re-download, the logs don't report what version it thinks it is using. What docker run
or compose snippet are you using to pass VERSION
. Can you also double check you have pulled the latest image?
$ kubectl logs -n minecraft --follow minecraft-server-69cdc4d664-wfqtl
Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Mar 25 17:26 /data'
Checking version information.
Checking type information.
Downloading minecraft_server.1.15.2.jar ...
Creating server.properties in /data/server.properties
Setting server-name to 'Dedicated Server' in /data/server.properties
Setting server-port to '25565' in /data/server.properties
Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
Skip setting allow-nether
Skip setting announce-player-achievements
Skip setting enable-command-block
Skip setting spawn-animals
Skip setting spawn-monsters
Skip setting spawn-npcs
Skip setting spawn-protection
Skip setting generate-structures
Skip setting view-distance
Skip setting hardcore
Skip setting snooper-enabled
Skip setting max-build-height
Skip setting force-gamemode
Skip setting max-tick-time
Skip setting enable-query
Skip setting query.port
Setting enable-rcon to 'true' in /data/server.properties
Setting rcon.password to 'lmaotest' in /data/server.properties
Setting rcon.port to '25575' in /data/server.properties
Skip setting max-players
Skip setting max-world-size
Setting level-name to 'world' in /data/server.properties
Skip setting level-seed
Setting pvp to 'true' in /data/server.properties
Skip setting generator-settings
Setting online-mode to 'true' in /data/server.properties
Skip setting allow-flight
Setting level-type to 'DEFAULT' in /data/server.properties
Skip setting resource-pack
Skip setting resource-pack-sha1
Setting difficulty to '1' in /data/server.properties
Checking for JSON files.
Copying any mods over...
Setting initial memory to 1G and max to 1G
Starting the Minecraft server...
OpenJDK Zero VM warning: G1 GC is disabled in this release.
[21:03:48] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[21:03:48] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:03:48] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:03:48] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[21:03:48] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[21:03:48] [Server thread/INFO]: Starting minecraft server version 1.15.2
[21:03:48] [Server thread/INFO]: Loading properties
[21:03:48] [Server thread/INFO]: Default game type: SURVIVAL
[21:03:48] [Server thread/INFO]: Generating keypair
[21:04:07] [Server thread/INFO]: Starting Minecraft server on *:25565
[21:04:07] [Server thread/INFO]: Using default channel type
[21:04:08] [Server thread/INFO]: Preparing level "world"
[21:04:10] [Server thread/INFO]: Found new data pack vanilla, loading it automatically
[21:04:10] [Server thread/INFO]: Reloading ResourceManager: Default
snippet from minecraft-server.yml deployment:
spec:
containers:
- env:
- name: EULA
value: "true"
- name: ENABLE_RCON
value: "true"
- name: RCON_PASSWORD
value: *****
image: itzg/minecraft-server:rpi3@sha256:61eb3c135db540eff27048743d6f162c91297cac23daf2003c72b67737d8c0a4
imagePullPolicy: IfNotPresent
name: minecraft-server
ports:
- containerPort: 25565
name: main
protocol: TCP
As you can see I haven't provided a "VERSION" - I assumed that without, it would pull the latest, and it does appear to do just that.
I've spent some more time investigating this and it appears that actually this "old" message is just telling me this server hasn't started up properly yet.
But looking at these logs - it is taking an awfully long time. I realise this is a Pi I'm running it on, but the Pi4 4GB is quite significantly more powerful than the Pi3 - which I assume this image has worked well on before since you have an rpi3 tag?
I'll leave the server to load overnight and see what happens.
I couldn't help myself - kept digging.
I found some bench results on different jvm implementations on ARM hardware - it seems the image you use is using an interpreter - you'll have to forgive me a little since I'm not really into the Java world so don't understand much about the ecosystem.
Anyway, having read the above I thought I'd have a crack at switching out the base image for something a little heavier but more performant - you can find my image here:
https://hub.docker.com/repository/docker/goyface/mc-server-rpi4-test
I'm using the bellsoft openjdk server runtime, and what was taking hours to even prepare the server now loads the server fully in roughly 5 mins - logs for comparison here:
I would make a PR to change this but I'd like to test it and get your feedback first, also I was having some issues running your Dockerfile - specifically the easy-add tool you've made - seems to fetch your archives fine but then fails to find the binaries - so I've sloppily downloaded them myself and just COPY'd them in my Dockerfile.
A lot of great information here to digest. A quick question I have at first is what led you to select the bellsoft JVM?
A lot of great information here to digest. A quick question I have at first is what led you to select the bellsoft JVM?
Nothing clever, it was just the first one I found with a working ARM image.
I have a new problem now though, which I think will lead me to choose a different JVM image.
When connecting to the server, which now displays correctly in the client, the client and server both log out:
[22:47:12] [User Authenticator #1/INFO]: Disconnecting com.mojang.authlib.GameProfile@ad65d3[id=<null>,name=Goyface,properties={},legacy=false] (/10.244.1.41:42058): Authentication servers are down. Please try again later, sorry!
[22:47:12] [User Authenticator #1/ERROR]: Couldn't verify username because servers are unavailable
This Reddit thread implies that it's something to do with OpenJDK - I'll try and find a different one and have a crack at it.
I'm going to re-image my RaspberryPi 3 B+ and try out some different JVMs, such as https://hub.docker.com/_/adoptopenjdk . BTW, I'll need to completely revive that rpi3
tag since I haven't refreshed it from the mainline in quite a while.
...BTW, the multiarch branch is now Debian based in order to allow more flexibility in multiarch JVM base images
https://github.com/itzg/docker-minecraft-server/tree/multiarch
...oh, it's already using adoptopenjdk's JRE HotSpot image. Perhaps give itzg/minecraft-server:multiarch
a try.
...oh, it's already using adoptopenjdk's JRE HotSpot image. Perhaps give
itzg/minecraft-server:multiarch
a try.
This suffers the same slowness that the rpi3 image has unfortunately.
The problem exists when the output of java -version
contains this:
OpenJDK Zero VM (AdoptOpenJDK)(build 25.232-b09, interpreted mode)
Specifically "interpreted mode" - the running everything through the interpreter I think is what's causing the performance drop.
EDIT: Success!
Running from this image I get a loadup time about a minute longer than with the Bellsoft image - but the server WORKS! I can join into it now!
To clarify, this is your multiarch image with the FROM line replaced with
FROM adoptopenjdk/openjdk11:armv7l-debian-jdk-11.0.6_10
There was an error getting mysql-client in the image build but in my haste I just removed it - what's that there for?
EDIT2: Performance is not great (Noticeable lag, one timeout, server logs complaining of running multiple hundred ticks behind) - but it works - I think we could benefit from finding an image that runs not in "mixed" or "interpreted" mode - I'll explore that more tomorrow. I imagine the Pi is somewhat limiting, but surely it can handle just one client running on the same network as it without these issues? I intend to run this for just up to 5 people at a time - with all except me external to the network, and I'm sure that must be achievable, right?
@0xVox thanks for the update. I ran out of patience even waiting for the incredibly slow docker build
process on my rpi 3 B+. Even an ARG
statement would take about 10-20 seconds, which is crazy slow compared to all other hardware I have used.
Where I left off was pushing an armv7
branch with a base image that probably ends up being the same as what you found:
I used a similar analysis as you and also started one with -e JVM_XX_OPTS="-XX:+PrintCompilation"
to confirm methods were getting JIT compiled during startup.
I think I'll have to leave it at that after adding armv7
to the versions update script at
With that, it will ensure I keep that branch up to date with the mainline (master
branch) changes.
...FYI, I introduced a new branch because the Docker BuildKit mechanism used with the multiarch branch doesn't allow for alternate base images per target os/arch/variant :(
Great work mate, your branch looks good - only one small issue is that you haven't release an "armv7" easy-add - so when it tries to download it it fails. I just edited the dockerfile locally to use the "armv6" binary and it worked great - none of the issues I had with it above appeared :)
This "Mixed mode" runs interpreted at startup to collect execution metrics but then runs compiled thereafter - so I think this is the way forward.
I think this issue can be closed, for anyone looking for a TLDR:
"Old" appears when the server hasn't finished loading yet, the image you're running may be running java in interpreted mode which makes it incredibly slow especially on Pi hardware. Images have been updated to run a JVM in mixed mode - which I explained above. This improved performance drastically on my rpi4.
Cheers @itzg - coffee coming your way.
Oops, I did the bad thing :) and pushed that branch without retesting that final change to the easy-add version. CircleCI/Github was being flaky that day, so I'll see if I can redo that release build...
and coffee much appreciated @0xVox
I fixed the armv7
branch and also pushed a build of the image at itzg/minecraft-server:armv7
.
Hello guys! First of all, really nice to see active development like this, thanks @itzg and everyone involved!
I tried the armv7
image with the following docker compose config on RPI4 4GB variant:
version: '3.7'
services:
mc:
image: itzg/minecraft-server:armv7
container_name: mc
restart: unless-stopped
environment:
EULA: "true"
TYPE: "PAPER"
VERSION: "1.15.2"
WHITELIST: "name1, name2"
ALLOW_NETHER: "true"
ANNOUNCE_PLAYER_ACHIEVEMENTS: "true"
SNOOPER_ENABLED: "false"
ONLINE_MODE: "false"
MEMORY: "2G"
GUI: "false"
JVM_XX_OPTS: "-XX:+UnlockExperimentalVMOptions -XX:ActiveProcessorCount=3"
command: --noconsole
ports:
- 25565:25565
volumes:
- ${PWD}:/data
The server start time is about 4 minutes now, with the multiarch variant it took one night long to prepare the spawn area then the rpi crashed, so its good for now I think.
I could login successfully but right after login I get this message and after it sometimes too:
[13:43:36] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5077ms or 101 ticks behind
[13:44:15] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 8978ms or 179 ticks behind
[13:46:20] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5343ms or 106 ticks behind
(To be honest, I'm just started tinkering with minecraft 3 days ago, never played or deployed a server before)
I found this project based on PaperMC as well and applied the JVM options used there as:
JVM_XX_OPTS: "-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled"
and of course restarted the container. Right after server start I get a "Cant keep up" message but while playing nothing in the server logs, only the game is a bit laggy (=sometimes stuck for a millisec but playable), maybe its a client problem I dont know. Im not a JVM expert so dont blame me if any of the above options is complete nonsense :)
If you would like, I can test any changes really fast, just let me know!
(ps: Could you suggest a good seed for a first time map? Right now the generated is a small island in the middle of the ocean and I dont think its great to start :D )
Nevermind the JVM options, after a longer test period, still getting the "Cant keep up" message
@stewe93 I also get the same little bit of lag and those messages - I'm not sure what further optimization can be made - the paper mc server does seem to have better performance but as you said - same issues.
I'll have a crack at it in the next few days, maybe it's just limitations of running this on a Pi, but I would expect better from the larger Pi4 variant.
@stewe93 thanks for the info and that's a bummer the extra JVM args didn't help.
As for a seed, yeah, world generation where it creates an island in an ocean suck :) I usually wipe and rebuild the server when that happens. Otherwise, you can google around for some good seeds to use such as
I'll mark this issue closed, but we can continue to share findings here or over in the Discord channel https://discord.gg/DXfKpjB
Nevermind the JVM options, after a longer test period, still getting the "Cant keep up" message
Hey guys, I think I've found the bottleneck on my end: IO speed.
Check out the benchmarks here: https://jamesachambers.com/raspberry-pi-storage-benchmarks-2019-benchmarking-script/
I was running this server with the data volume on a mid range Sandisk microSD card, which claims to run at 100MB/s - this doesn't seem to be true and the drive scored a terrible 1111 points on their benchmark.
Category Test Result
HDParm Disk Read 39.92 MB/s
HDParm Cached Disk Read 33.49 MB/s
DD Disk Write 14.1 MB/s
FIO 4k random read 3143 IOPS (12572 KB/s)
FIO 4k random write 763 IOPS (3055 KB/s)
IOZone 4k read 10880 KB/s
IOZone 4k write 3490 KB/s
IOZone 4k random read 9423 KB/s
IOZone 4k random write 2441 KB/s
Score: 1111
Running the same bench on my 1TB USB3.0 Portable HDD scored ~6x higher:
Category Test Result
HDParm Disk Read 25.77 MB/s
HDParm Cached Disk Read 31.53 MB/s
DD Disk Write 22.9 MB/s
FIO 4k random read 13438 IOPS (53753 KB/s)
FIO 4k random write 1590 IOPS (6360 KB/s)
IOZone 4k read 67968 KB/s
IOZone 4k write 17168 KB/s
IOZone 4k random read 67741 KB/s
IOZone 4k random write 16935 KB/s
Score: 6185
The most important metrics here are the 4k rand read/write scores - and you can see the microSD performs awfully in those metrics. The HDD absolutely blows it out of the water.
The result when I ran the server with the data volume on the higher scoring drive was much more promising - far fewer "Can't keep up" messages - and when they did appear they were never more than 105 ticks behind.
I've ordered a USB3 Solid State drive - one near the top scoring on those benchmarks (SanDisk Extreme Portable SSD 250 GB 550 MB/s) - and I'll report back with the results.
Can't believe I missed this metric to be honest - but now I think we can comfortable say we have a route to running this on a Pi with better results!
Update: With the faster drive, this server is booting in 80 seconds, I also bumped it up to use 2750MB of memory. Not bad! Oh, yeah, and if you're going to play with fire or TNT (In the server ;P ) - make sure you've got a fan on your Pi!
I am launching Minecraft 1.15.2 Server in RPI3 as follows:
docker run -d -p 25565:25565 --name minecraft_server -v /minecraftServer:/data -e EULA=TRUE -e ONLINE_MODE=FALSE itzg/minecraft-server:rpi3
In the Minecraft Client 1.15.2, the server appears as Old. Throught the process of establishing connection, I get a timeout in encryption phase.