mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-25 12:54:32 +02:00
Damien Claisse reported in issue #3257 a performance regression between 3.2 and 3.3 when task profiling is enabled, more precisely in relation with the following patches were merged:98cc815e3e("MINOR: activity: collect time spent with a lock held for each task")503084643f("MINOR: activity: collect time spent waiting on a lock for each task")9d8c2a888b("MINOR: activity: collect CPU time spent on memory allocations for each task") The issue mostly comes from the first patches. What happens is that the local time is taken when entering and leaving each lock, which costs a lot on a contended system. The problem here is the lack of finegrained settings for lock and malloc profiling. This patch introduces a better approach. The task profiler goes back to its default behavior in on/auto modes, but the configuration now accepts new extra options "lock", "no-lock", "memory", "no-memory" to precisely indicate other timers to watch for each task when profiling turns on. This is achieved by setting two new flags HA_PROF_TASKS_LOCK and HA_PROF_TASKS_MEM in the global "profiling" variable. This patch only parses the new values and assigns them to the global variable from the config file for now. The doc was updated.