Ad Widget

Collapse

large history_uint and history tables and granular cleanup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhooge
    Junior Member
    • Jan 2023
    • 2

    #1

    large history_uint and history tables and granular cleanup

    Hello,

    We are running zabbix 6.0.19
    The tables history_uint and history within our mariadb are getting large (200GB and 100GB) because of the amount of data retrieved and kept (180 days)
    I am wondering if there is an option to cleanup these tables in a specific way?
    eq.
    We log the disk usage every minute and keep it for 180 days the be able to create some graphs, but we only require the first 30 days to have that short interval of 1 minute for analysis , after that it is perfectly fine to keep a value for once every hour to have some historical view.
    I can't find a way of performing this cleanup except manually deletion from the tables with is something I prefer not to do.
    Any ideas on how to solve this challenge, are there 3rd party solutions for this, or even better, can this be configured from within Zabbix and am I overlooking this option?

    Regards,

    John
    Last edited by jhooge; 12-10-2023, 07:33.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    First of all, reduce your history keeping period... Housekeeper should remove unnecessary data. But IIRC mysql/mariadb do not release the disk space automatically, you need to do some tricks there to gain it back... I do not remember exactly, what it was you need to do, but some searching about reducing disk space for mariadb shoudl give you some answers...

    Comment

    • jhooge
      Junior Member
      • Jan 2023
      • 2

      #3
      Thank you the reply, shortening the history is not really an option as I am required to report over a period of 6 months for some of our customers.
      My primary issue is not the physical size of the tables, but more that I just keep way to much information for the period 30-180 days and I would like to clean up some entries like disk, cpu and network usage to keep just one entry per 60 minutes.
      The whitespace in the tables that I will get back is just fine, that means also that we can monitor more devices with more or less the same table sizes

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        You could consider using TimescaleDB with compression, you should end up with less disk space requirements: https://blog.zabbix.com/how-to-deplo...-plugin/13668/

        Official documentation: https://www.zabbix.com/documentation...ll/timescaledb

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #5
          That would require change of DB platform... I am not sure its worth the effort.

          But if you need longer history only for some clients, then maybe you can implement items history and trends periods using user macros. For some customers you can set it to shorter period, for some longer.
          Trends, by nature, is exactly, what you are looking for - a record of items min/avg/max per 1h. So you can easily draw a graph based on that info for longer period.

          Comment

          Working...