[ZBX-14648] slow deletion of item in template linked to many hosts Created: 2018 Jul 26  Updated: 2024 Apr 10  Resolved: 2018 Nov 30

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 3.4.10
Fix Version/s: 4.0.3rc1, 4.2.0alpha2, 4.2 (plan)

Type: Problem report Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Alexander Vladishev
Resolution: Fixed Votes: 1
Labels: massdelete, massupdate, performance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Selection_032.png    
Issue Links:
Causes
causes ZBX-15373 Problem persists after item was deleted Closed
causes ZBX-15458 Undefined offset: 0 [ in report2.php:... Closed
Team: Team B
Sprint: Sprint 39, Sprint 40, Sprint 41, Sprint 42, Sprint 43, Sprint 44, Sprint 45, Sprint 46, Nov 2018
Story Points: 3

 Description   

Information below is gathered from discussion with a zabbix user.

When we delete an item from template, linked to 10K hosts, it takes too much time, and in 99% of attempts it returms nothing (supposedly PHP error happens).

There were changes in ZBX-6118, where it's stated:

Improved performance of create(), update() and template linkage methods for item, discoveryrule and itemprototype classes.

which does not include items deletion.

Besides of the zbx, there are also ZBX-13335, ZBX-13348, ZBX-13349 fixed, but they also do not talk about deletion.

And one more thing:
We have a user with limited rights, access to only one host group with ~500 hosts. When opening Configuration -> Hosts, page is loading very long time.
A super admin user opens the same page really fast.

Zabbix 3.4.9. © 2001–2018, Zabbix SIA                           
******************** Профилировщик сценария ********************
Всего затрачено времени: 1593.176998                            
Всего затрачено времени на SQL: 0.072697                        
SQL запросов: 46 (selects: 44 | executes: 2)                    
Пиковое использование памяти: 14.25M                            
Лимит памяти: 512M                                              

Note - I'm not sure what the provided debug belongs too - opening a page or deletion items.
Strange thing that debug section does not contain some fields if compare with a testing zabbix installation.



 Comments   
Comment by richlv [ 2018 Jul 26 ]

Slow permission checks have been reported many times in the past, a few issues that are still open:

Comment by Alexander Vladishev [ 2018 Aug 17 ]

Available for testing in development branch svn://svn.zabbix.com/branches/dev/ZBX-14648-trunk

item.delete(), itemprototype.delete(), trigger.delete(), triggerprototype.delete(), graph.delete(), graphprototype.delete() - improved overall performance and memory consumption, added/improved audit logging, added strict validation for input parameters.

I could not reproduce the second problem - Configuration -> Hosts opened fast with admins and super-admins. zalex_ua, please create separate issue if this problem still relevant.

Tests (delete an item from template, linked to another template which linked to 10K hosts):

  trunk dev branch
super-admin Total time: 20.471309
Total SQL time: 15.502797
SQL count: 30164 (selects: 10111 | executes: 20053)
Peak memory usage: 526.195313M
Total time: 4.788167
Total SQL time: 4.284156
SQL count: 131 (selects: 92 | executes: 39)
Peak memory usage: 138.179688M
admin Total time: 21.414525
Total SQL time: 16.978923
SQL count: 30165 (selects: 10112 | executes: 20053)
Peak memory usage: 526.195313M
Total time: 5.889939
Total SQL time: 5.385905
SQL count: 132 (selects: 93 | executes: 39)
Peak memory usage: 138.179688M
Comment by Alexander Vladishev [ 2018 Nov 30 ]

Fixed in:

  • 4.0.3rc1 r87480
  • 4.2.0alpha2 (trunk) r87479
Generated at Sat Apr 27 05:57:58 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.