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 Loading Event Log page throws ER_OUT_OF_SORTMEMORY

    Support
    3
    7
    222
    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.
    • d19dotca
      d19dotca last edited by d19dotca

      I noticed when viewing the Event Log page in Cloudron that I get an odd error I haven’t seen reported yet… ‘’’ER_OUT_OF_SORTMEMORY’’’

      998101D0-FDEC-463D-9B52-7CB220BBD453.jpeg

      I don’t see any OOM errors yet in any logs, and I have the same memory values set for quite a long time now without seeing this issue before.

      As best I can tell from a quick search online, the error seems to be MariaDB related, but there’s nothing in the MySQL service logs around that time other than healthcheck requests. I found this page that references increasing the sort buffer size… https://mariadb.com/docs/reference/mdb/error-codes/ER_OUT_OF_SORTMEMORY/

      Memory itself seems fine from what I can tell on the server, with no OOM log entries that I can see. Plenty of memory allocated too to each service.

      3953CD8C-14C3-46B2-82A6-AE757277F322.jpeg

      Any thoughts on what to set for the sort buffer size? And does it seem necessary to do for new installs too? Is it something wrong in my setup instead?

      --
      Dustin Dauncey
      www.d19.ca

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

        @d19dotca this is related to the mysql instance on the ubuntu system itself I assume, since this is where the eventlog resides. The mysql service addon is only for apps and not for the system itself.

        Looks like your eventlog is quite huge then!

        If you want you can try to increase that innodb sort buffer size by adding for example:

        innodb_sort_buffer_size=2097152
        

        to the mysqld section in /etc/mysql/mysql.cnf on the ubuntu system and then systemctl restart mysql

        The default seems to be 1048576, so this would double it.

        1 Reply Last reply Reply Quote 1
        • girish
          girish Staff last edited by

          I think innodb_sort_buffer_size is to control the buffer size when index is created i.e using ALTER command - https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_sort_buffer_size . What we probably need here is sort_buffer_size. Like:

          sort_buffer_size = 4M
          

          Looks like we are missing an index for the creationTime field (since we use ORDER BY to list the eventlog).

          1 Reply Last reply Reply Quote 1
          • girish
            girish Staff last edited by

            I have added the indices in the next release.

            d19dotca 1 Reply Last reply Reply Quote 1
            • d19dotca
              d19dotca last edited by

              Funny enough, I went to look at the Event Log this morning and it doesn't throw the same error anymore and seems to load correctly. Not sure what the cause was there, but seems like it's okay at least for now. For context, I moved from OVH to a new Vultr instance, not sure if the Vultr instance has different MySQL settings in their Ubuntu image though I thought Cloudron overwrote the /etc/my.cnf file anyways, so not sure if that's relevant.

              --
              Dustin Dauncey
              www.d19.ca

              1 Reply Last reply Reply Quote 0
              • d19dotca
                d19dotca @girish last edited by d19dotca

                @girish I was just looking at the Git PR for this... https://git.cloudron.io/cloudron/box/-/commit/2421536c235c8025b1bbdfe8671a9ea016834042#1ee7de92349500e2dcdc985a7cd620f916ac8170

                I noticed it seems the file being modified is mysql.cnf rather than my.cnf... if I were to manually add these changes for the time being, which file should I be editing exactly? Why is mysql.cnf seemingly a duplicate of my.cnf? This is throwing me off a bit, lol.


                EDIT: Just realized it seems the my.cnf file is just a symlink, so I gues this makes more sense now. haha. Basically the real settings are coming from /etc/mysql/myswql.cnf, right?

                --
                Dustin Dauncey
                www.d19.ca

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @d19dotca last edited by

                  @d19dotca said in Loading Event Log page throws ER_OUT_OF_SORTMEMORY:

                  Basically the real settings are coming from /etc/mysql/mysql.cnf, right?

                  Yes, they are the same file as you found out. In any case, the change I made is good because ORDER BY <xx> should always have xx indexed in the database to lower memory use.

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