[ZBX-8924] Slow query on Administration->Notifications page Created: 2014 Oct 19  Updated: 2017 May 30  Resolved: 2016 Apr 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.6, 2.4.1
Fix Version/s: 2.2.13rc1, 3.0.3rc1, 3.2.0alpha1

Type: Incident report Priority: Blocker
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: performance, query, regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File zbx-8924-2.2.patch.gz     File zbx-8924-2.4.6.patch.gz    
Issue Links:
Duplicate
duplicates ZBX-6910 Fatal error: Allowed memory size Open

 Description   

It happens since Zabbix 2.2.

Zabbix 2.0
******************** Script profiler ********************
Total time: 2.325396
Total SQL time: 0.221551
SQL count: 227 (selects: 55 | executes: 172)
Peak memory usage: 186.75M
Memory limit: 2048M
Zabbix 2.2
******************** Script profiler ********************
Total time: 27.945257
Total SQL time: 26.143435
SQL count: 53 (selects: 21 | executes: 32)
Peak memory usage: 77M
Memory limit: 2048M

The page uses API query which performs the next query:

SELECT a.alertid,a.mediatypeid,a.userid,a.clock FROM alerts a WHERE EXISTS (SELECT NULL FROM events e WHERE a.eventid=e.eventid AND e.source='0' AND e.object='0') AND a.clock>'1388340000' AND a.clock<'1413675166';


 Comments   
Comment by Gunars Pujats (Inactive) [ 2015 Sep 28 ]

The same problem with Administration -> Notifications page in issue ZBX-6910.

Comment by Gunars Pujats (Inactive) [ 2015 Sep 28 ]

(1) No translation strings changed.

iivs CLOSED

Comment by Gunars Pujats (Inactive) [ 2015 Sep 28 ]

RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-8924

Comment by Alexander Vladishev [ 2015 Oct 15 ]

(2) We do not use direct SQL queries in the PHP code. The solution should be rewritten by using API requests.

gunarspujats Created API method for getting notifications data. RESOLVED in r56414.

sasha New API method can be created only in the new major releases and with specification. This issue must be fixed without such changes.

REOPENED

sasha Alternative solution was implemented. WON'T FIX

Comment by Ivo Kurzemnieks [ 2016 Apr 15 ]

On my environment SQL performance sometimes improves almost two times.
Before: 1,7 sec
After: ~1 sec

patch TESTED

Comment by Alexander Vladishev [ 2016 Apr 28 ]

Fixed in:

  • pre-2.2.13 r59773
  • pre-3.0.3 r59774
  • pre-3.1.0 (trunk) r59775
Comment by Oleksii Zagorskyi [ 2016 Nov 16 ]

This issue fix is not complete, to be fixed also in ZBX-11193.

Generated at Tue Apr 23 20:48:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.