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. Support
  3. Resizing an app in Cloudron, seems to take much longer than it used to

Resizing an app in Cloudron, seems to take much longer than it used to

Scheduled Pinned Locked Moved Support
feature-requestmemoryoptimization
7 Posts 3 Posters 1.3k 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.
    • d19dotcaD Offline
      d19dotcaD Offline
      d19dotca
      wrote on last edited by girish
      #1

      This may just be me misremembering as I don't have to do this often, but lately I've been resizing some of my apps to sort of follow my own "standard" for the app type, and anyways it seems it takes the app offline much longer than it used to. When I used to do this several months back, I thought it would only be roughly a minute offline for the app, if that. But it seems like it almost takes 2-5 minutes depending on the app (image size?), and I'm not sure if that's honestly how it's always been and I just never noticed, or if it's a performance degradation over the last several Cloudron updates. Anyone else notice this, or is it just me?

      Edit: Slightly different topic, but in the event it's always been this long and I'm just going crazy, lol.... why does it take this long to change the memory of an app? I can change the memory instantly on any of the system services, why do app changes require so much time to do the same thing?

      --
      Dustin Dauncey
      www.d19.ca

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

        Changing the memory limit currently recreates the docker container for the app and thus also means the app is restarted. Essentially if you restart the app without resizing the memory limit it should more or less take the same time, since container recreation is usually quite fast.

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

          I was waiting for someone to notice before optimizing 🙂

          At container level, adjusting memory limit does not require us to re-create or restart the container. Indeed, this is how the Service view memory limit code works. It does not re-create or restart the service. But for the app memory limit, we re-create and restart the container because that was what was easier and we haven't optimized that code path. IIRC, the reason for this was there are some apps that adjust their settings based on the memory allocated to the container. For example, I think WordPress configures itself to have more apache processes when given more memory. This code is part of the app startup script. By restarting the app, we solved these cases.

          d19dotcaD 1 Reply Last reply
          4
          • girishG girish

            I was waiting for someone to notice before optimizing 🙂

            At container level, adjusting memory limit does not require us to re-create or restart the container. Indeed, this is how the Service view memory limit code works. It does not re-create or restart the service. But for the app memory limit, we re-create and restart the container because that was what was easier and we haven't optimized that code path. IIRC, the reason for this was there are some apps that adjust their settings based on the memory allocated to the container. For example, I think WordPress configures itself to have more apache processes when given more memory. This code is part of the app startup script. By restarting the app, we solved these cases.

            d19dotcaD Offline
            d19dotcaD Offline
            d19dotca
            wrote on last edited by
            #4

            @girish @nebulon - Thank you for your responses. Seems like it could be improved a bit further though, no? I ask because it seems to me that when I deploy an app for the first time, it passes the "Creating container" step pretty quickly, but when I resize it, the "Creating container" step in particular seems to take a lot longer. Theoretically they should take the same amount of time, no? But this isn't what I observe in my environment.

            --
            Dustin Dauncey
            www.d19.ca

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

              Yes, it should theoretically take the same amount of time (at least, in my demo setup it is the same). In any case, I think the best fix is to skip recreating the container entirely when just the memory limits are changed.

              d19dotcaD 1 Reply Last reply
              1
              • girishG girish

                Yes, it should theoretically take the same amount of time (at least, in my demo setup it is the same). In any case, I think the best fix is to skip recreating the container entirely when just the memory limits are changed.

                d19dotcaD Offline
                d19dotcaD Offline
                d19dotca
                wrote on last edited by
                #6

                @girish Ah interesting, maybe it's all in my head then. haha. I can run some more tests if it'll help. Ultimately I just want to reduce downtime to near-zero whenever possible.

                But you mentioned that some apps require the restart, so does that mean they'll require the container to be recreated?

                I'm okay with it the way it is if it'll prevent other issues. Just was a concern to me earlier because I thought the time actually increased lately anytime I change the memory, but maybe I'm wrong there and it's all in my head. 😛

                Whatever you feel works best to minimize downtime while ideally not causing issues for some apps that may be require the full restart / recreation, that will be best. 🙂

                --
                Dustin Dauncey
                www.d19.ca

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

                  Correct. We don't need to re-create container to change the memory limit. But we still need to restart it after adjusting memory limit because of the limitations in our packaging.

                  I think over time we have learnt that it is not a good idea to setup apache to auto-scale based on container memory limit. Those things are very dependent on the app/plugin use. I think java apps require a restart at this point since the JVM gets passed in the heap memory as a flag on startup, maybe there is a workaround for this as well, have to investigate.

                  But at that point, we can atleast make the memory limit code not re-create container which I think is where bulk of the slowness is.

                  1 Reply Last reply
                  2
                  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