Perflog Templates on Windows 2008 Servers

Introduction

To be able to go back to see how a server was utilizing it’s resources at a specific time, you need to enable “Performance Logging” within the Pefmon tool. The data collected can be instrumental in troubleshooting certain system and performance issues. What these instructions will do is to save Key Performance Counters in a file under C:\Perflogs so you can gather information from a specific point in time if and when it is needed.

To ensure capturing these counters will not affect performance, we will capture every counter in the following groups – the way Microsoft created the Perfmon capturing is that it will capture the entire group first, then only write the specific counters if you specify specific counters. Telling it to capture the whole Counter Group does reduce processing. The counters this process will collect are:

\Memory\*
\Network Interface(*)\*
\Paging File(*)\*
\PhysicalDisk(*)\*
\Process(*)\*
\Processor(*)\*
\Processor Performance(*)\*
\Server\*
\System\*
\SQLServer:Access Methods\*
\SQLServer:Buffer Manager\*
\SQLServer:Databases(*)\*
\SQLServer:General Statistics\*
\SQLServer:Latches\*
\SQLServer:Locks(*)\*
\SQLServer:Memory Manager\*
\SQLServer:SQL Statistics\*
\Web Service(*)\*

This process will start the collecting at the top of every hour, collect these counters every 10 seconds for that hour, then start again writing to a new file. Doing this will keep the file size down and ensure that a server restart will only stop capturing data for at most 59 minutes.

Other options that were decided and the reasoning behind them are:

  • Capture Every 10 Seconds – According to many professionals, capturing Windows® Performance Stats more frequently than 5 seconds can introduce statistical anomalies. On the flip side, setting it to a larger period of time can introduce issues with not collecting enough data. To keep logs at a reasonable 8-15MB per hour (depending on the server configuration), we chose to collect every 10 seconds (which is also a nice round number).
  • Directory set to C:\Perflogs – This allows you to easily bypass the security settings on this folder and these files. Simply adjust the C:\Perflogs security and the files will also use these settings. If you put them in a sub-directory then the people that need access need to be in specific local groups on the server.
  • Set the filename to SERVERNAME_Perflog_YYYYMMDDHH – Setting these logs to a specific pattern allows for easier manipulation/automation to be performed against them (future AppAdminTools products will utilize this pattern).

Importing the Template

Download the W2K8 Data Collector Template

Prior to adding the Data Collector Set, first open the Perfmon and ensure that there isn’t already a Data Collector Set that is already capturing data.

>Check for Existing Data Collector Sets

If there is an existing Data Collector Set and it is only capturing a minimal amount of data, that should be fine, but if it is capturing a lot of data, it might be wise to just combine the 2 – see what that one is capturing, ensure that the counters that it is capturing are the ones listed on the previous page, if not, document what it is capturing so you can add those to the new Data Collector Set, then stop and delete that Data Collector Set.

To import the new Data Collector, download this W2K8 Data Collector Template and simply run the following command in a command prompt to import the settings:

logman import -n "AppAdmin_Perf" -xml AppAdmin_monitor-w2k8.xml

If it throws an error, ensure you provide the full path to the XML File. Once it is imported, the Data Collector Set should start at the top of the hour.

Additional Steps

Even though you should now be capturing the performance data, there are a few steps that you will need to consider:

Create a Share – To easily process the data, you may want to create a share for the C:\Perflog directory. Since these capture the data to the root of the C:\Perflog directory you should be able to adjust permissions accordingly without needing to add the users who need access to the local “Performance” Groups.

Clean up the Older PerfLogs – This process will not automatically delete the Perflog files. You must provide a way to automatically clean up the files you no longer need. We provide a utility that allows you to automatically compress, archive and delete files based on file age – ZipDeleteFiles.