Ad Widget

Collapse

Database bloating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oNERa
    Junior Member
    • Nov 2020
    • 6

    #1

    Database bloating

    Hi,

    I am using Zabbix to monitor 245 hosts, all cisco switches. What actions would you recommend to keep the the database from bloating?

    Ubuntu 20.04.5 LTS
    Zabbix 5.2.7
    Values per second - 762.85
    Postgres v12

    I am already set up Autovaccum - is there any other actions/tasks i can perform to keep the DB lean as possible?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    245 hosts and 762 NVPS? You must be polling a lot of stuff, very often...
    Want to lean down your DB? Poll less..

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #3
      In the short run the solution is to adjust the item intervals, as mentioned. That will keep the amount of new data tolerable.

      In the long run the usual solution is using database partitioning. That will make sure that old data will be efficiently deleted in chunks (instead of consuming resources while deleting old data one by one by the housekeeper, leaving gaps in the database). With PostgreSQL the usual way is to use TimescaleDB, there are instructions for that in Zabbix manual: https://www.zabbix.com/documentation...ll/timescaledb

      Markku

      Comment

      • oNERa
        Junior Member
        • Nov 2020
        • 6

        #4
        Thanks for the ideas! i will install Timescale DB.
        in the meantime - is there any way to delete the content of database? (delete all the rows but not the DB Itself) , i am using postgresql 12

        Comment

        • guille.rodriguez
          Senior Member
          • Jun 2022
          • 114

          #5
          I think you are searching the truncate command

          https://www.postgresql.org/docs/curr...-truncate.html

          Be careful, I think you can trucante this tables
          • history
          • history_uint
          • history_str
          • history_text
          • trends
          • trends_uint


          That only deletes the collected data, not the definition of the items, etc
          Last edited by guille.rodriguez; 26-10-2022, 20:03.

          Comment

          Working...