Four waits cover SQL Trace writing to and reading from trace files, and this page takes them together:
SQLTRACE_FILE_BUFFER: synchronization on trace buffers during a file trace, meaning a wait for exclusive access to a trace buffer before writing it to the file.SQLTRACE_FILE_WRITE_IO_COMPLETION: documented as internal use only; waiting for a write to a trace file to complete.SQLTRACE_FILE_READ_IO_COMPLETION: internal use only; waiting for a read from a trace file, such as someone reading one withfn_trace_gettable.SQLTRACE_PENDING_BUFFER_WRITERS: internal use only, with no published description; from the name, waiting for pending buffer writers to finish.
Are They a Problem?
Rarely. They are not known contention points, though they could lengthen under I/O contention. On our SQL Server 2025 lab, with the default trace running, there was one buffer wait in a day and nothing else. Get Wait Statistics does not filter them out.
The trace that does cost time is the rowset trace behind Profiler, which shows as TRACEWRITE; file traces are the lighter way to run SQL Trace.
When They Do Matter
If they ever grow, either the trace file’s disk is slow or someone is reading very large trace files. See which traces are running and where they write:
SELECT
id,
is_default,
is_rowset,
path,
event_count
FROM sys.traces;
is_default = 1 is the default trace, and is_rowset = 1 is a Profiler-style rowset trace. The baseline to monitor is the list of running traces matching what you expect. SQL Trace is deprecated; Extended Events is the replacement. The query needs ALTER TRACE permission.
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
- SQLTRACE file waitsFile trace. Buffers and I/O for traces written to file, including the default trace.Usually noise. This page.
- 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
These trace file waits are usually tiny. If you are chasing a real problem, start with the waits that cost you time.
- TRACEWRITE, the rowset trace wait that does cost time.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply