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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved redis (on lamp) is stuck due to high memory usage

    LAMP
    redis lamp memory
    2
    4
    729
    Loading More Posts
    • 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.
    • M
      msbt App Dev last edited by

      I was migrating magento to a lamp app including redis as page cache. Everything worked fine for a few hours, but at some point I'm getting this message via email

      37daff30974b5378e8463859563b0028e07babc9ecda9b5663f38d1ab888baef  exited unexpectedly using too much memory!
      ...
      
      {"status":"oom","id":"37daff30974b5378e8463859563b0028e07babc9ecda9b5663f38d1ab888baef","from":"cloudron/redis:1.0.0","Type":"container","Action":"oom","Actor":{"ID":"37daff30974b5378e8463859563b0028e07babc9ecda9b5663f38d1ab888baef","Attributes":{"image":"cloudron/redis:1.0.0","location":"magentoshop.tld","name":"redis-b9e519bd-f638-4ba9-8334-1ab2c569b31a"}},"scope":"local","time":1531611212,"timeNano":1531611212713282300}
      
      -------------------------------------
      

      Usually a flushdb did the trick to get it working again, but right now I can't even send commands via cli, it's showing

      (error) LOADING Redis is loading the dataset in memory

      even if I only try to ping (or flushing) it. /usr/bin/redis-server is running wild on CPU, how can I stop it from loading and clear that db - and more importantly, how can I limit the memory on redis so it won't crash every few hours? I would be thankful for a quick reply, since I've already shut down the former machine and due to the missing cache, the magento shop is terribly slow.

      Best regards

      1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        The redis addon container is running on limited memory. Out of the box this is 150mb.
        You may want to try temporarily increase that with:

        docker update <container id> --memory 512m --memory-swap 1g
        

        Maybe the 150m is just too low for it to work well, given the magento load and thus it is busy doing garbage collection.

        1 Reply Last reply Reply Quote 0
        • M
          msbt App Dev last edited by

          I've given the server more memory and after some time it eventually was able to clear out the db. I've also disabled redis for the time being and will try to play around with the allocated memory of your suggestion, thanks for that.

          Does this setting affect the maxmemory setting of redis? Some people suggest 1GB, others 2GB+ for several 1000 items in the db (current shop has 6000+), that wouldn't be a problem I reckon? I'll try some numbers next week and keep this thread updated if you like.

          1 Reply Last reply Reply Quote 0
          • nebulon
            nebulon Staff last edited by

            Would be great if you could update this thread with your findings. Also please note that the memory settings for the addons are currently not preserved across app restores or even server reboots. We are working on this fix and you can see the status of it at https://git.cloudron.io/cloudron/box/issues/566

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB