Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-5318

Increase debug performance with one log file per process

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 4.4.0alpha1
    • Server (S)

      Currently, if debug log level is activated in several process, it have a big impact on performance.

      Using LogType=file, each time a process wants to write to the log file it have to adquire the lock.

      When those debugged process have some load, getting the log lock becomes harder, blocking the processes and reducing their performance.

       

      In the attached patch I propose a change so each debugged process write its debug/trace messages to a different file, removing the need for locking.

      Once debug is enabled, new files are created, for example:

       

      /var/log/zabbix/zabbix_server.log.1234
      /var/log/zabbix/zabbix_server.log.1235
      /var/log/zabbix/zabbix_server.log.1236

       

      Being the numbers the PID of the debugged procs.

       

      I have made a small performance test, comparing the normal debug mode (all to same file, with locking) and the new system.
      The test was 4 scripts writing 4000 values 10 times, measuring the total time it took to send all of them.
      Without debugging, each script took around 14s.
      With normal debugging around 63s.
      With multifile debugging around 17s.

       

      I hope this patch could help to debug performance issues, where enabling the debug have such a big impact that is not useful.

            wiper Andris Zeila
            adrian.lopez Adrian Lopez
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: