Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-6763

Significant performance difference of API method event.get depending on user type

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 2.0.6
    • API (A)
    • Linux, CentOS-6.4, PostgreSQL 9.1.9, Apache HTTPD-2.2.15, PHP-5.3.3

      There is a significant performance difference in using the API method event.get depending on the user type. The performance of event.get is extremely slow and very heavy for the database in cases where user type is not 'Zabbix Super Admin'.

      I encounter this issue while testing a 3rd party Zabbix mobile application. After starting the mobile application it wasn't long before the whole Zabbix system became unavailable due to an overloaded Zabbix database.
      It turns out that the heavy load was caused by several calls of the API method event.get.

      I reproduced the issue by putting the following command twice into a script file for execution. The first call was always set with an 'Zabbix Super Admin' authentication token:

      1. curl -i -X POST -H 'Content-Type:application/json' -d'
        Unknown macro: {"jsonrpc"}

        ' https://zabbix.example.com/zabbix/api_jsonrpc.php > /dev/null

      Execution with 1st authentication token = 'Zabbix Super Admin' takes 2 seconds.
      Execution with 2nd authentication token = 'Zabbix User' takes 57 seconds.

      Execution with 1st authentication token = 'Zabbix Super Admin' takes 2 seconds.
      Execution with 2nd authentication token = 'Zabbix Admin' takes 57 seconds.

      Execution with 1st authentication token = 'Zabbix Super Admin' takes 2 seconds.
      Execution with 2nd authentication token = 'Zabbix Super Admin' takes 2 seconds.

      The execution time is multiplied by the number of hostids to query.
      See attached EXPLAIN.txt for the execution plan.

            zabbix.dev Zabbix Development Team
            okkuv9xh Marc
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: