Extended Events: is Ring Buffer data supposed to be in File target as well?

  • I was under impression that such data should always be in correlation but in practice am not always consistently able to confirm it:

    shouldn't what is in Ring Buffer be automatically synched with data in FILE?

    and the second part of the question: IF SO, then why should I really even bother with the Ring Buffer? (unless I want to watch Live Data which is a low value /low use feature anyway..)

     

    Thank you.

    Likes to play Chess

  • My understanding is that they are 2 completely different data capture methods.  Ring buffer is a buffer and only exists in memory.  The advantage to this is that you are less likely to have anything dropped.

    Dumping data to file is a LOT slower than to memory, so I would expect they could be out of sync.  And writing to file, as it is slower, may result in some data being dropped to avoid performance issues on the SQL instance.

     

    Experts correct me if I am wrong on this.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • The ring buffer stores the information only in memory and does not store it also in a file.  There are some problems with ring buffer.  The first problem is that the you get one XML that shows you all the events that were caught.  The output XML can be too large to show all the events that were caught by the extended event session.   In such case it will just ignore some of the events that were collected and won't show it in the XML.  You will be able to see only parts of the events that were collected.  If you don't expect to catch many event, then it isn't a problem.  The second problem is that if the SQL server will reboot, you will loose all the events that were captured.  If you store the events in a file, you will not loose the data that was captured in case of a reboot.

    Adi

  • I generally advocate against using the ring buffer. It affects the memory of the server in a negative way, worse than simply negative depending on what you're capturing. Instead, I usually write everything to file. BTW, you can use the Live Data Explorer window to look at data being captured to the file in real time (and Live Data is actually really useful, depending on what you need, check out this video). As to them being in sync, yeah, barring outside influences (memory pressure, cpu pressure), they will be identical. However, Extended Events are actually very safe and will start dropping events in the case of external pressure. This is much more likely with the ring buffer, so you may see things out of sync.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply