Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Minecraft
  3. Minecraft server package seems to be unstable?

Minecraft server package seems to be unstable?

Scheduled Pinned Locked Moved Solved Minecraft
16 Posts 3 Posters 2.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      W Offline
      warg
      wrote on last edited by
      #1

      Hello,

      I just installed the Minecraft server package and after 2 minutes the server complained about being laggy/not processing events quick enough. Afterwards I destroyed a few blocks and I got disconnected because connection was resetted/lost. Rejoining doesn't work (error "Connection refused: no further information"). Server log just shows this:

      Aug 05 14:07:24 [12:07:24] [Server thread/INFO]: <username> joined the game
      Aug 05 14:07:24 [12:07:24] [Server thread/INFO]: <username>[/<ip>:<port>] logged in with entity id <id> at (-19.5, 66.0, 57.5)
      Aug 05 14:07:24 [12:07:24] [User Authenticator #1/INFO]: UUID of player <username> is <uuid removed>
      Aug 05 14:09:40 [12:09:40] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 3086ms or 61 ticks behind
      

      What could be the root cause? I didn't change the memory settings or anything else. It's not a Forge server (Minecraft Server package v1.8.1).

      Best Regards,

      1 Reply Last reply
      0
      • W Offline
        W Offline
        warg
        wrote on last edited by
        #2

        Nevermind . . . the app crashed because out of memory so the default memory setting isn't enough. I will increase it to 2 GB.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          warg
          wrote on last edited by
          #3

          Could it be that setting the memory limit is broken? I'm asking because of this:

          Aug 05 14:22:14 Failed to determine memory limit. Falling back to 1024M
          Aug 05 14:22:14 Server is up and running on port <port>
          Aug 05 14:22:14 Use ldap auth
          Aug 05 14:22:14 start minecraft server with memory limit 1024 M
          
          1 Reply Last reply
          0
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #4

            I can reproduce this, appears related to cgroup v2.

            1 Reply Last reply
            0
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #5

              Fixed in https://git.cloudron.io/cloudron/minecraft-app/-/commit/6691478e868062801b5a5b13123437b2e4d7ab2b

              1 Reply Last reply
              2
              • W warg marked this topic as a question on
              • W warg has marked this topic as solved on
              • W Offline
                W Offline
                warg
                wrote on last edited by
                #6

                Can you apply the fixes for Forge as well please? Thanks!

                1 Reply Last reply
                1
                • W Offline
                  W Offline
                  warg
                  wrote on last edited by
                  #7

                  The fix is sadly not completely working. It does read the value without an error now but the value is wrong. I did set 4 GB of RAM for Forge and it did output this in the console:

                  Aug 09 21:05:18 Starting Forge Server with memory limit 3277M

                  So it looks like the wrong unit is used.

                  1 Reply Last reply
                  0
                  • W warg has marked this topic as unsolved on
                  • nebulonN Offline
                    nebulonN Offline
                    nebulon
                    Staff
                    wrote on last edited by
                    #8

                    Can you open a webterminal and read the vile /sys/fs/cgroup/memory/memory.limit_in_bytes to see how much the container actually got allocated in the end?

                    On Linux with docker containers have memory limits set with parts swap and physical memory (half half). So the memory limit calculation for Cloudron also takes this into account to prevent user error, without having to educate about the technical details much. Anyway those limits are upper limits and not reserved memory per app. Those act as a safety net to prevent a rouge app to bring down the whole server or also guide language runtimes like java/ruby/nodejs/... do not cache too much and run their garbage collectors more often. Essentially make them behave better in environments where they don't have the whole system on their own.

                    In Cloudron you can see the actual memory limit set in the backend calculated here: https://git.cloudron.io/cloudron/box/-/blob/master/src/system.js#L207

                    W 1 Reply Last reply
                    0
                    • nebulonN nebulon

                      Can you open a webterminal and read the vile /sys/fs/cgroup/memory/memory.limit_in_bytes to see how much the container actually got allocated in the end?

                      On Linux with docker containers have memory limits set with parts swap and physical memory (half half). So the memory limit calculation for Cloudron also takes this into account to prevent user error, without having to educate about the technical details much. Anyway those limits are upper limits and not reserved memory per app. Those act as a safety net to prevent a rouge app to bring down the whole server or also guide language runtimes like java/ruby/nodejs/... do not cache too much and run their garbage collectors more often. Essentially make them behave better in environments where they don't have the whole system on their own.

                      In Cloudron you can see the actual memory limit set in the backend calculated here: https://git.cloudron.io/cloudron/box/-/blob/master/src/system.js#L207

                      W Offline
                      W Offline
                      warg
                      wrote on last edited by
                      #9

                      @nebulon said in Minecraft server package seems to be unstable?:

                      Can you open a webterminal and read the vile /sys/fs/cgroup/memory/memory.limit_in_bytes to see how much the container actually got allocated in the end?

                      I don't find the file you have mentioned, neither in the container nor from the shell as root. There's a /sys/fs/cgroup/ directory and memory.* files in it but no memory.limit_in_bytes.

                      1 Reply Last reply
                      0
                      • girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by girish
                        #10

                        I reworked the minecraft* apps to use a single code base now. The fixes are:

                        • oidc support
                        • memory limit computation (cgroup v2)
                        • duplicate log lines
                        • better log lines in the ui
                        • various other ui issues
                        • log history

                        Big thanks to @warg for all the bug reports. I have already fixed up the forge app, the other two will follow shortly today.

                        1 Reply Last reply
                        2
                        • girishG girish has marked this topic as solved on
                        • W Offline
                          W Offline
                          warg
                          wrote on last edited by
                          #11

                          Thank you for fixing all of this!

                          1 Reply Last reply
                          1
                          • W Offline
                            W Offline
                            warg
                            wrote on last edited by
                            #12

                            Beside of the fixes and the Forge app and Minecraft app doing nothing (no players, new world so nothing automatically running, e. g. redstone stuff, no mods) + having plenty of free RAM, the server is unstable according to its logging:

                            Aug 10 12:05:57 [10:05:57] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 3277ms or 65 ticks behind
                            Aug 10 12:22:59 [10:22:59] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 6428ms or 128 ticks behind
                            Aug 10 12:36:09 [10:36:09] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 9279ms or 185 ticks behind
                            Aug 10 12:39:44 [10:39:44] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 11625ms or 232 ticks behind
                            Aug 10 20:48:30 [18:48:30] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 6541ms or 130 ticks behind
                            Aug 10 21:51:17 [19:51:17] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 12512ms or 250 ticks behind
                            Aug 10 21:58:43 [19:58:43] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 14030ms or 280 ticks behind
                            Aug 11 00:26:51 [22:26:51] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 8281ms or 165 ticks behind
                            Aug 11 04:43:37 [02:43:36] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 5874ms or 117 ticks behind
                            Aug 11 06:14:26 [04:14:26] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 3928ms or 78 ticks behind
                            Aug 11 06:30:14 [04:30:14] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 5482ms or 109 ticks behind
                            Aug 11 07:20:26 [05:20:26] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 11857ms or 237 ticks behind
                            Aug 11 09:04:06 [07:04:06] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 9322ms or 186 ticks behind
                            Aug 11 09:12:49 [07:12:49] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 25424ms or 508 ticks behind
                            Aug 11 09:22:43 [07:22:43] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Is the server overloaded? Running 4898ms or 97 ticks behind
                            

                            Does someone else face this? What else could be the root cause here? I don't think it's related to any resource bottleneck.

                            1 Reply Last reply
                            0
                            • girishG Offline
                              girishG Offline
                              girish
                              Staff
                              wrote on last edited by
                              #13

                              I noticed this as well. I assume this is related to too little memory or low CPU. Have you tried allocating much more RAM? I can test this later as well and maybe also change the default memory allocation.

                              1 Reply Last reply
                              0
                              • W Offline
                                W Offline
                                warg
                                wrote on last edited by warg
                                #14

                                RAM is always idling between 1 and 2 GB while 4 is assigned. CPU should be fine too, at least I don't notice any performance issues or bottlenecks within the OS or other apps. The only other thing that is slow at the moment is Nextcloud 27.0.2 but that could be due to the latest update? Not sure. I will assign 8 GB RAM. Let's see.

                                1 Reply Last reply
                                0
                                • W Offline
                                  W Offline
                                  warg
                                  wrote on last edited by
                                  #15

                                  Nope, increasing it from 4 to 8 GB RAM didn't help. Seems something else is wrong.

                                  1 Reply Last reply
                                  0
                                  • nebulonN Offline
                                    nebulonN Offline
                                    nebulon
                                    Staff
                                    wrote on last edited by
                                    #16

                                    If not memory related, then disk I/O speeds and cpu could be a possible bottleneck? How is cpu utilization as shown with top or htop while the minecraft app is showing those message?

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Bookmarks
                                      • Search