Ad Widget

Collapse

Deleting 77K+ items takes more than 30 minutes and eventually fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ILIV
    Junior Member
    • Oct 2012
    • 28

    #1

    Deleting 77K+ items takes more than 30 minutes and eventually fails

    I was wondering if anyone has ever tried to Unlink and Clear a template associated with a host that has as many as 77K+ items.

    In our case it's an extremely slow process that can easily run for 30 and more minutes and will make PHP ask for a lot of memory.

    Eventually PHP just stucks after a (longish) while and we can't delete these apx 80 thousands of items.

    This is being experienced on a VMWare virtual machine with 4GB of RAM, single 1,6GHz CPU. It's a dedicated VM that runs Zabbix Server and PostgreSQL DB, both tuned with reasonable performance in mind.

    When using vm.overcommit=2 the strict mode, PHP simply errors out with Out Of Memory/failed to allocate "this much" bytes of memory.

    When using vm.overcommit=0 it struggles for a while but then fails anyway.

    Usually when PHP errors out the page in the browser tab is blank below the upper menu. One time though, we got lucky and received a proper error message that looked like this:

    pg_query(): Query failed: ERROR: deadlock detected
    DETAIL: Process 25273 waits for ShareLock on transaction 20899;
    blocked by process 24958.
    Process 24958 waits for ShareLock on transaction 17363; blocked by
    process 25273.
    HINT: See server log for query details. [include/db.inc.php:511]

    • Error in query [DELETE FROM items WHERE itemid IN
    ('175786','175787','175788','175789','175790','175 791','175792','175793','175794','175795','175796', '175797','175798','175799','175800','175801','1758 02','175803','175804','175805',
    The DELETE query was a REALLY long one listing hundreds and hundreds of itemid's. The above example has been cut for brevity's sake.

    My question is if anyone manipulates bulks of items in numbers as high as at least 70K and if yes, can you delete those? If yes, how much time does it take your setup to do that? What are your system specs? Did you have to make any specific configuration adjustments to PHP (or anything else) to be able to delete this many items in one shot?

    PS: oh, it's Zabbix 2.0.3, PHP 5.3.10, Apache 2.2.22
    Last edited by ILIV; 18-07-2013, 21:25.
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    How many hosts are you monitoring?

    To have Zabbix App server, DB server and web server running on a VM with 1 CPU and only 4GB of RAM? Ouch.

    Comment

    • ILIV
      Junior Member
      • Oct 2012
      • 28

      #3
      4 hosts in total, 3 of those *each* have apx 77-80K items that were prototyped via custom LLD template.

      So, when I unlink and clear this custom template it translates into bulk deletion of apx 77K+ items.

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Not many hosts. So this is just a guess on my part that the delete is a large query and your setup doesn't have the resource power to handle it, so it just chokes on it.

        Comment

        • ILIV
          Junior Member
          • Oct 2012
          • 28

          #5
          Yeah, this is what I'm thinking too. Hence my question if anyone can actually delete 70K+ items in bulk and how fast that happens for them on their systems.

          Comment

          • Pada
            Senior Member
            • Apr 2012
            • 236

            #6
            It depends on how much history/trend data those items have!
            Also, the PHP housekeeper is terrible.

            See the modifications that I've made to the PHP frondend to avoid these kind of problems: https://www.zabbix.com/forum/showthread.php?t=37486
            * I can't say that it will fix/solve your issue, but there is a big possibility that it will.

            Comment

            Working...