Skip to main content

Active Transaction

A transaction in progress is called "active transaction." A stack that has been regularly dumped by an active transaction is called active stack.

Note

The WhaTap agent dumps active stacks for active transactions every 10 seconds (optional) and sends them to the server. active_stack_second=10

Collecting the compact active stacks

Because the active stack regularly performs thread dumps, it can add lots of overheads to the agent if implemented incorrectly. WhaTap has various options to collect active stacks while minimizing the agent load.

Tip

In Sitemap > Thread List/Dump, from the thread list, the overhead can be determined by checking the CPU time of the WhaTap-ActiveStackDump thread.

Optimized data collection

  • Dump the stack only for the thread that is performing transactions.

  • You can adjust the active stack dump time interval.

    active_stack_second=10

  • It is limited to the maximum line of the active stack. It collects 50 lines from the top line by default.

    trace_active_callstack_depth=50

  • Each hashed line of the active stack is collected. Text is collected only once.

  • The maximum number of active stacks collected at a time is limited.

    active_stack_count=100

Active Stack for Background Threads

Basically, the active stack means the stack of the thread in which transactions are being processed. You may need to analyze the stack for some background threads as well. At this time, the active stack for the background thread can be obtained using the option. It is available since the version 1.6.2.

  • If the value of async_stack_enabled is set to true, the function is enabled.

    async_stack_enabled=false
  • The stack dump interval depends on the foreground active stack setting.

    active_stack_second=10
  • When setting the target thread name, use * to specify the string pattern.

    async_thread_match=http*,abc*

    The stack dump target is determined by the thread name. Using comma (,), you can specify multiple matches.

  • If the top method of the stack is a class or method registered in async_thread_parking, the system considers that the thread is parked and does not generate any dump.

    async_thread_parking_class=sun.misc.Unsafe
    async_thread_parking_method=park

References