Ad Widget

Collapse

Issue after removing unwanted hosts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #1

    Issue after removing unwanted hosts

    Hello folks,

    my environment,
    RHEL 5.3
    MySQL 5.0.77
    Zabbix 1.8.4

    I keep history, actions, events, trends for 800 days

    A couple of days ago I removed two hosts (they both contained around 2k of items in total).
    Since, I noticed that MySQL using 10-15 % of CPU (its way over it used to).
    Because of MySQL high CPU load, I guess, my frontend performance deteriorated. Now it takes around 5-8 seconds to load dashboard.php

    Any suggestions what can be done in order to make MySQL work as normal as it used to?


    Thank you for response in advance!
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #2
    for better understanding adding screenshots
    Attached Files

    Comment

    • heaje
      Senior Member
      Zabbix Certified Specialist
      • Sep 2009
      • 325

      #3
      Wow, that's an incredibly long time to keep data.

      If you have the housekeeper enabled, it may account for why MySQL started using up more CPU when you deleted those hosts. You have history,trends,etc. for around 2000 items that now have to be deleted.

      Comment

      • Davidus
        Senior Member
        • Dec 2010
        • 281

        #4
        Originally posted by heaje
        Wow, that's an incredibly long time to keep data.

        If you have the housekeeper enabled, it may account for why MySQL started using up more CPU when you deleted those hosts. You have history,trends,etc. for around 2000 items that now have to be deleted.
        Thank you for response!

        Comment

        • Davidus
          Senior Member
          • Dec 2010
          • 281

          #5
          Can I somehow check if zabbix done deleting those 2000 items?
          Even though it’s already been 1 week since I pressed the delete button MySQL still uses lot of CPU

          Comment

          • Davidus
            Senior Member
            • Dec 2010
            • 281

            #6
            In addition,
            I see no active process in mysql
            Click image for larger version

Name:	mysql.jpg
Views:	1
Size:	77.6 KB
ID:	312078

            while
            Click image for larger version

Name:	linux.jpg
Views:	1
Size:	65.6 KB
ID:	312079

            Comment

            • BDiE8VNy
              Senior Member
              • Apr 2010
              • 680

              #7
              If you delete large parts of a table it might be necessary to run OPTIMIZE TABLE. See MySQL documentation for details.

              Comment

              • heaje
                Senior Member
                Zabbix Certified Specialist
                • Sep 2009
                • 325

                #8
                Just out of curiosity, have you tuned mysql at all? In the screenshot, you have an awful lot of ram not being used at all. Using the default mysql configuration parameters could easily cause issues like you're seeing.

                Comment

                • Davidus
                  Senior Member
                  • Dec 2010
                  • 281

                  #9
                  Originally posted by heaje
                  Just out of curiosity, have you tuned mysql at all? In the screenshot, you have an awful lot of ram not being used at all. Using the default mysql configuration parameters could easily cause issues like you're seeing.
                  Previously, I had no need of doing database tuning, because MySQL was working just fine; but definitely thinking of doing it now.

                  Comment

                  • Davidus
                    Senior Member
                    • Dec 2010
                    • 281

                    #10
                    Originally posted by BDiE8VNy
                    If you delete large parts of a table it might be necessary to run OPTIMIZE TABLE. See MySQL documentation for details.
                    Would you recommend executing mysqlcheck --optimize --all-databases' ?
                    Last edited by Davidus; 13-03-2013, 08:59.

                    Comment

                    • Davidus
                      Senior Member
                      • Dec 2010
                      • 281

                      #11
                      Originally posted by heaje
                      Just out of curiosity, have you tuned mysql at all? In the screenshot, you have an awful lot of ram not being used at all. Using the default mysql configuration parameters could easily cause issues like you're seeing.
                      By the way, can you recommend any particular article on BD tuning? I got totally confused reading all this different methods and recommendations in google

                      Thank you in advance!
                      Last edited by Davidus; 13-03-2013, 09:28.

                      Comment

                      • BDiE8VNy
                        Senior Member
                        • Apr 2010
                        • 680

                        #12
                        Originally posted by Davidus
                        Would you recommend executing mysqlcheck --optimize --all-databases' ?
                        Consult the MySQL documentation if this command would lock excessively what may lead to blocking queries or updates.

                        A good starting point to tune MySQL for beginners is the MySQL Performance Tuning Primer Script

                        Comment

                        • Davidus
                          Senior Member
                          • Dec 2010
                          • 281

                          #13
                          Originally posted by BDiE8VNy
                          Consult the MySQL documentation if this command would lock excessively what may lead to blocking queries or updates.

                          A good starting point to tune MySQL for beginners is the MySQL Performance Tuning Primer Script
                          Thanks a lot! I’ll try it out

                          Comment

                          • Davidus
                            Senior Member
                            • Dec 2010
                            • 281

                            #14
                            Eventually, problem was solved without human intervention
                            CPU is back to normal, frontend is working fine.
                            Thank you guys for your support!
                            Last edited by Davidus; 18-03-2013, 11:53. Reason: typo

                            Comment

                            • heaje
                              Senior Member
                              Zabbix Certified Specialist
                              • Sep 2009
                              • 325

                              #15
                              Just a suggestion, but you should really look at tuning your MySQL configuration even though your problem is gone. The defaults are anything but optimized for anything more than a very small Zabbix installation.

                              Comment

                              Working...