Ad Widget

Collapse

Zabbix database growing too large

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gumis_148
    Member
    • Jan 2019
    • 52

    #1

    Zabbix database growing too large

    My database seems to be growing too quick and I installed it two weeks ago and has just 3,7G and 7,0G. At such a rate, after a few months they will have 100G.


    Code:
    3,7G    history.ibd
    7,0G    history_uint.ibd


    Code:
    Filesystem      Size  Used Avail Use% Mounted on
    udev            964M     0  964M   0% /dev
    tmpfs           198M  1,3M  197M   1% /run
    /dev/sda6       9,4G  4,1G  4,9G  46% /
    tmpfs           987M     0  987M   0% /dev/shm
    tmpfs           5,0M     0  5,0M   0% /run/lock
    tmpfs           987M     0  987M   0% /sys/fs/cgroup
    /dev/sda5       9,4G  1,9G  7,1G  21% /var
    /dev/loop0      161M  161M     0 100% /snap/gnome-3-28-1804/116
    /dev/loop3      3,8M  3,8M     0 100% /snap/gnome-system-monitor/127
    /dev/loop5      4,3M  4,3M     0 100% /snap/gnome-calculator/544
    /dev/loop2       55M   55M     0 100% /snap/core18/1668
    /dev/loop7      1,0M  1,0M     0 100% /snap/gnome-logs/81
    /dev/loop4      1,0M  1,0M     0 100% /snap/gnome-logs/93
    /dev/loop11      15M   15M     0 100% /snap/gnome-characters/399
    /dev/sda1       464M  115M  321M  27% /boot
    /dev/loop12      45M   45M     0 100% /snap/gtk-common-themes/1440
    /dev/loop13      49M   49M     0 100% /snap/gtk-common-themes/1474
    [B]/dev/sda8        45G   12G   31G  28% /var/lib/mysql[/B]
    /dev/loop10     3,8M  3,8M     0 100% /snap/gnome-system-monitor/135
    /dev/sda7       4,9G   84M  4,6G   2% /home
    /dev/loop6      4,4M  4,4M     0 100% /snap/gnome-calculator/704
    /dev/loop8       15M   15M     0 100% /snap/gnome-characters/495
    /dev/loop9       92M   92M     0 100% /snap/core/8689
    tmpfs           198M   16K  198M   1% /run/user/121
    /dev/loop14      55M   55M     0 100% /snap/core18/1705
    /dev/loop15      94M   94M     0 100% /snap/core/8935
    tmpfs           198M     0  198M   0% /run/user/1000


    Code:
    mysql> SELECT plugin_status FROM information_schema.plugins WHERE plugin_name = 'partition';
    +---------------+
    | plugin_status |
    +---------------+
    | ACTIVE        |
    +---------------+
    1 row in set (0.08 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `history_uint`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 09:55:45       |
    +---------------------------+
    1 row in set (15 min 51.91 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `history_str`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 09:55:45       |
    +---------------------------+
    1 row in set (0.53 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `history_text`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 13:50:35       |
    +---------------------------+
    1 row in set (0.20 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `history_log`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | NULL                      |
    +---------------------------+
    1 row in set (0.01 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `history`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 09:55:25       |
    +---------------------------+
    1 row in set (6 min 36.06 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `trends_uint`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 09:00:00       |
    +---------------------------+
    1 row in set (56.97 sec)
    
    mysql> SELECT FROM_UNIXTIME(MIN(clock)) FROM `trends`;
    +---------------------------+
    | FROM_UNIXTIME(MIN(clock)) |
    +---------------------------+
    | 2020-03-17 09:00:00       |
    +---------------------------+
    1 row in set (15.31 sec)

    I have innodb_file_per_table = 1 in my.cnf:

    Code:
    [mysqld]
    user            = mysql
    pid-file        = /var/run/mysqld/mysqld.pid
    socket          = /var/run/mysqld/mysqld.sock
    port            = 3306
    basedir         = /usr
    datadir         = /var/lib/mysql
    tmpdir          = /tmp
    lc-messages-dir = /usr/share/mysql
    skip-external-locking
    innodb_file_per_table = 1

  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    What is the question? You have installed a system for collecting data - it is collected.
    What to collect, with what frequency, and how much to store-you determine yourself.
    Analyze the data you collect and disable what you don't need.
    Think about the need to collect data frequently and correct the periods in the data elements.
    Pay special attention to LLD-these rules can create many data elements that you didn't know about.

    Comment

    • gumis_148
      Member
      • Jan 2019
      • 52

      #3
      Originally posted by Hamardaban
      What is the question? You have installed a system for collecting data - it is collected.
      What to collect, with what frequency, and how much to store-you determine yourself.
      Analyze the data you collect and disable what you don't need.
      Think about the need to collect data frequently and correct the periods in the data elements.
      Pay special attention to LLD-these rules can create many data elements that you didn't know about.
      Question: why is the database growing so quickly? It is not normal that after 2 weeks it is about 10G. And you can check which data occupy the most in the database?
      Ok, I will check LLD, thanks.




      Comment

      Working...