TRACEWRITE Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: ASYNC_NETWORK_IO Wait TypeRelated pillar: Performance & Troubleshooting
⚡TRACEWRITE is the SQL Trace rowset provider, the one Profiler uses, waiting for trace buffers. It grows when events are produced faster than the client reads them. Run the check to list running traces and find the rowset one.

Microsoft’s definition: it occurs when the SQL Trace rowset trace provider waits for either a free buffer or a buffer with events to process. The rowset provider is the path used when a client reads trace events live, which in practice means SQL Server Profiler or an application reading a trace over the connection. There is no fuller description of it published.


Is It a Problem?

Yes, when it is significant. It is commonly reported that a Profiler trace with broad event selections against a busy server makes the whole workload sluggish until the Profiler window closes. It was zero on our SQL Server 2025 lab, where only the default file trace runs. Get Wait Statistics does not filter it out, so if it ranks, you will see it.

The baseline to monitor is zero running rowset traces outside a deliberate investigation.


Common Causes

  • Profiler running against production, especially over a slow network link.
  • Applications or tools reading trace events live.
  • Traces with broad event coverage on high-throughput systems.
  • Traces left running after the investigation ended.

The Check To Run

Rank it against everything else with Get Wait Statistics, then list running traces:

SELECT
    id,
    status,
    is_rowset,
    is_default,
    path,
    event_count,
    start_time
FROM sys.traces;

is_rowset = 1 is a live, Profiler-style trace. is_default = 1 is the default trace, which writes to file. The query needs ALTER TRACE permission.


What To Do

  1. Stop or narrow the rowset trace: sp_trace_setstatus stops a trace by its id; if tracing must continue, capture fewer events with tighter filters, to a local file rather than live.
  2. Move to Extended Events; SQL Trace is deprecated, and Extended Events is the replacement.
  3. Check sys.traces as part of routine health checks so abandoned traces do not linger.

The TRACE Family

These are the SQL Trace waits. SQL Trace is deprecated in favour of Extended Events, but the default trace still runs on most instances. The one that costs time is the rowset trace behind Profiler. If one is near the top of your waits, read it next to the waits that usually matter.

  • TRACEWRITERowset trace. The rowset trace provider, used by Profiler, waiting for buffers.Worth investigating. This page.
  • SQLTRACE file waitsFile trace. Buffers and I/O for traces written to file, including the default trace.Usually noise
  • SQLTRACE_INCREMENTAL_FLUSH_SLEEPFlush timer. Documented as internal use only; the trace flush sleeping between runs.Usually noise
  • TRACE_EVTNOTIFEvent notifications. Documented as internal use only.Worth a look when it climbs

Where To Go Next

If TRACEWRITE is sitting near the top of your wait stats, these are the next places to look.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *