Announcement

Collapse
No announcement yet.

mysql governor not restricted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mysql governor not restricted

    Hello,

    I use WHM + cloudlinux + mysql governor
    MySQL Governor mode: abusers
    Mariadb 10.6

    I have websites on the same server
    One of the users is consuming more resources than specified
    Load up to 1100% cpu
    Note that the limit is 200% for mysql​ and 200% for lve

    I verified that the username exists in dbuser-map

    Is there a way to prevent the user from exceeding the mysql limit cpu?

  • #2
    Hi,

    Where did you got the 1100% from? A screenshot would be helpful.

    Please check if the user has been restricted with:
    Code:
    cat /var/log/dbgovernor-restrict.log | grep username

    Comment


    • #3
      in error log file
      /var/log/dbgovernor-restrict.log

      Many of this

      [Mon Nov 13 11:29:53 2023] atehad LIMIT_ENFORCED period current value, field cpu value 1224/limit 200 loadavg(21.48 17.01 16.48 6/1320 1480511) vmstat( 4 0 177408 13655896 3659620 21766708 0 0 15783 460 1 1 10 4 79 7 0)cpu = 12.239489, read = 610293829, write = 8109

      Comment


      • #4
        Well, it says the user was restricted due to CPU overusage by mysql queries. Could you confirm regular CPU LVE limit for this user is set to 200? Please show the output of:

        Code:
        lvectl list-users | grep atehad
        But also, please try monitoring if queries are really placed in that LVE with:

        Code:
        lveps -p | grep -A 40 atehad

        Comment


        • #5

          [root@srv9 ~]# lvectl list-users | grep atehad
          error: unknown or missing command


          [root@srv9 ~]# lveps -p | grep -A 40 atehad
          atehad 0 44 --- 73 --- 786469 3790 662807192 2584183
          --- --- /usr/sbin/mariadbd --- 878384 3229 9190 N/A N/A
          --- --- /usr/sbin/mariadbd --- 878363 3083 9190 N/A N/A
          --- --- /usr/sbin/mariadbd --- 878357 3152 9190 N/A N/A
          --- --- /usr/sbin/mariadbd --- 877505 3256 9190 N/A N/A
          --- --- /usr/sbin/mariadbd --- 875739 3266 9190 N/A N/A
          --- --- /usr/sbin/mariadbd --- 235319 3781 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---1820355 5126 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---3354902 8338 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592870 8568 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592769 8623 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592754 8667 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592546 8618 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592545 8956 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2592419 9008 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2439070 9441 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2439040 7711 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2439036 9055 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435592 8796 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435587 8700 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435581 9307 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435580 9145 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435577 8743 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435569 8659 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435564 9161 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435561 8723 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435560 8920 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435555 9014 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435553 8718 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435549 8984 9190 N/A N/A
          --- --- /usr/sbin/mariadbd ---2435534 8842 9190 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2233471 0 82 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2233429 0 85 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2233339 0 85 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2233257 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232867 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232866 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232787 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232772 0 85 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232679 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232529 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232468 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232398 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232268 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232267 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232263 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232254 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232249 2 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232215 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232203 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2232049 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231828 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231766 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231751 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231632 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231353 2 87 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2231224 2 87 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230978 0 20 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230842 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230826 1 87 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230638 0 23 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230600 1 87 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2230461 1 87 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2229812 0 22 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2229607 0 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2229270 1 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2229253 1 86 N/A N/A
          --- --- lsphp:/atehad/public_ht ---2229155 1 91 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2228976 1 86 N/A N/A
          --- --- lsphp ---2228882 1 53 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2227209 2 86 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2226905 4 298 N/A N/A
          --- --- lsphp:/home/atehad/publ ---2224222 9 321 N/A N/A
          --- --- lsphp ---2061826 1 5 N/A N/A
          [root@srv9 ~]#


          * Please note that exceeding the maximum database consumption occurs with all clients
          But this user consumes more

          This means that the usage limits are exceeded for mysql cpu
          But Lve working fine ( There is no excess consumption )​

          Comment


          • #6
            Ah, sorry the command should be:

            Code:
            lvectl list-user | grep atehad

            Comment


            • #7

              [root@srv9 ~]# lvectl list-user | grep atehad
              atehad 600 16384M 0K 50 100 921600 1024

              Comment


              • #8
                This shows CPU Speed limit for this account is set to 600% . Could you please clarify where did you got the 1100% of CPU usage for this account from? Is it from `top` output?

                Comment


                • #9
                  Yes From ( Current Usage ) list mySQL speed

                  I set for this user
                  Lve = 600 % and mySQL = 200 %

                  I have attached an illustrative picture for you
                  Attached Files

                  Comment


                  • #10
                    It seems user is restricted by the 'current' limit and immediately released. Likely due to fast short queries. Let's investigate more, please provide the limits for other periods for him, as well part of governor config, e.g.:

                    Code:
                    dbctl list | grep atehad
                    Code:
                    cat /etc/container/mysql-governor.xml | egrep "lve use|intervals|limit current"
                    And, please a bit more of restrict log:

                    Code:
                    cat /var/log/dbgovernor-restrict.log | grep username | tail -20

                    Comment

                    Working...
                    X