Ad Widget

Collapse

Delete histoyr_uint Table Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepspa
    Junior Member
    • Aug 2016
    • 27

    #1

    Delete histoyr_uint Table Zabbix

    Hello,

    I am using zabbix 3.2 running on postgres database. The table size of history_uint has grown upto 187 GB and I think housekeeper couldn't clear them all. When I try to delete the content older than 180 days, its taking for ever. Is there any other way to clean up the table? This is causing lots of performance issue in zabbix server.
  • volter
    Member
    Zabbix Certified Specialist
    • Dec 2011
    • 85

    #2
    You need a long-term solution of some kind. The usual answer to this is table partitioning. Depending on your version of PG, there may be different solutions. Version 10 has something built in, but I don't know if it's totally usable yet.

    Maybe this can help you: https://zabbix.org/wiki/Troubleshoot...8PostgreSQL.29

    I'm using this: https://github.com/keithf4/pg_partman

    You usually want to turn off the housekeeper for the partitioned tables then.

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3
      Read the sticky post on this forum.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • pradeepspa
        Junior Member
        • Aug 2016
        • 27

        #4
        Thank you. I will look into it.

        Comment

        • tcilmo
          Senior Member
          • Nov 2016
          • 122

          #5
          You also might have to run housekeeper manually to help cleanup the tables, since by default it runs once an hour. Keep in mind, doing so might affect performance until the tables are cleaned up.

          zabbix_server -R housekeeper_execute

          You could even script the housekeeper to run in a continuous loop. If the housekeeper runs with another instance is already running, that attempt is just ignored.

          Code:
          counter=1
          while [ $counter -le 600000000000000 ]
          do
              zabbix_server -R housekeeper_execute
              sleep 15
              ((counter++))
          done

          Comment

          • pradeepspa
            Junior Member
            • Aug 2016
            • 27

            #6
            Originally posted by tcilmo
            You also might have to run housekeeper manually to help cleanup the tables, since by default it runs once an hour. Keep in mind, doing so might affect performance until the tables are cleaned up.

            zabbix_server -R housekeeper_execute

            You could even script the housekeeper to run in a continuous loop. If the housekeeper runs with another instance is already running, that attempt is just ignored.

            Code:
            counter=1
            while [ $counter -le 600000000000000 ]
            do
                zabbix_server -R housekeeper_execute
                sleep 15
                ((counter++))
            done

            Thank you. I have tried this way it helped reducing the load. I will keep an eye on it.

            Comment

            Working...