Published on

February 7, 2011

Understanding SQL Server Wait Types: LOGBUFFER

Wait types in SQL Server can provide valuable insights into the performance of your database. In this article, we will discuss one such wait type called LOGBUFFER.

LOGBUFFER occurs when a task is waiting for space in the log buffer to store a log record. This wait type is considered to be one of the top 5 wait types in SQL Server. While it may not be a common wait type, it can still have a significant impact on the performance of your server.

Consistently high values of LOGBUFFER may indicate that the log devices cannot keep up with the amount of log being generated by the server. This can lead to delays in transaction processing and overall degradation of performance.

In a scenario where I encountered LOGBUFFER, the log file (LDF) was placed on a local disk, while the data files (MDF, NDF) were stored on SanDrives. This file distribution was not optimal, and once we moved the LDF to a faster drive, the LOGBUFFER wait type disappeared.

If you are experiencing LOGBUFFER waits, here are some suggestions to reduce them:

  1. Move the transaction log to a separate disk from the MDF and other files. Ensure that the drive where the LDF is located does not have any IO bottleneck issues.
  2. Avoid cursor-like coding methodology and frequent commit statements. These can contribute to excessive log generation.
  3. Identify the most active file based on IO stall time. You can use scripts to analyze IO-related issues and find the problematic files.
  4. Check IO-related counters such as PhysicalDisk:Avg.Disk Queue Length, PhysicalDisk:Disk Read Bytes/sec, and PhysicalDisk:Disk Write Bytes/sec for additional details.

It is important to note that while the suggestions for reducing LOGBUFFER waits are similar to those for WRITELOG waits, these two wait types are not the same. They have different definitions and characteristics. However, both can severely impact the performance of your SQL Server.

It is recommended to test any changes on a development server before implementing them on a production server. Additionally, always refer to the official SQL Server documentation for further clarification and understanding of wait types.

Remember, wait types can vary from system to system, and it is crucial to monitor and analyze them to optimize the performance of your SQL Server.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.