In this video, I'd like to show you how to use the Lockman dot exe command line utility to capture performance logs. I will also briefly discuss usage of re lo dot exe and typer dot exe. These tools are useful when troubleshooting a windows server performance problem or when you simply need to capture a performance baseline. The commands that I'll be using are in the video description for you to copy. I'll begin with a quick overview of performance monitor. Notice that right from the start, it displays real time results of several useful counters, memory available megabytes, for instance bytes per second being handled by the various network interfaces, percentage idle time of the physical disk and percentage processor time of the systems CPU a real time graph for this last counter and for one minute is also visible on the monitoring tools.
Now, if you need to collect performance logs over an extended period, you can use the same tool to start a data collector set. I've created this one here using the graphical user interface and in its properties, you can see I've added counters commonly associated with a performance bottleneck other settings that we can adjust use. We include the log format. We can choose from four available options, the sample interval to specify how often these measurements will take place. And it is also possible to use the graphical user interface to ah specify circular logging to prevent the file from growing too much and fill in the disk. Let's see how we can configure all of this using the command line which will save you a lot of clicks if you need to set this up in multiple servers like in a cluster, for instance or with different parameters than those you can set up in the que. So here in powershell, I've typed this Lockman dot exe command. Let me go through what each parameter does before running it.
So first off, we're using Loman dot exc. This can be executed in powershell or a command line. I then type create counter to indicate that we're invoking this command to generate a new data collector set. Following is the name that we are assigning to this uh log file. I've chosen performance logs, but you can name it whatever you prefer. And then the F parameter to indicate the log format for the data collector. In this case, I've selected a binary circular file then is the max parameter. So to prevent the log file from occupying too much space on disk, we can limit it to a size. In this case, I've selected 500 megabytes. This is actually what the last part of the previous parameter uh means circular indicates that the file will grow up until that size if needed, then you will start overriding all the events with newer.
Thus preventing the file from growing beyond its limit. The next parameter is a sample interval. This is how often we want to capture these counters in hours, minutes or seconds. For this test. I've selected to collect these counters for each second. And finally, the dash C parameter or switch is used to indicate which counters will be included. This should be enclosing quotation marks and separated by a space. You can use an asterisk to as a as a wild card to specify all of the instances. For example, in this command will be collecting all of the memory counters. Also all of the network interface counters for all of the network cards in the system, all of the physical dis counters for all of the physical disks and all of the processor uh counters for all of the system's CPU. Now we know what each parameter does let's hit, enter to execute the command. And after a brief delay, you'll see on the right side in performance monitor that we have a new data collector set. And this has been created entirely using ah the command line.
If we examine the properties of this new data collector set, you'll notice that the counters that we included the log format that we specified the sample interval interval that we indicated. And also the setting for circular logging that we specified. All of these have been successfully applied to this data collector set from within the command line. Now to begin the process of collecting data, we can also start this data collector set using the command line. And in order to do so just type block man start and then the name of your data collector set. After a brief wait, you'll notice that the command completed successfully. And now back in the performance monitor window, you'll notice that this data collector set is now uh is now running. That means it's collecting data.
Ideally, you will let this run enough time to capture either a baseline or a period during which the performance problem that you're troubleshooting occurs. When you're confident you have enough data to begin uh analyzing, you need to stop this data collection. And in order to do so via the command line, you can just type Lockman and instead of start, we're gonna be using stop and just he entered after a brief delay again, you will notice that the data collector set in the right side and performance monitor is now stopped. The resulting performance file can be located typically or by default here under your C drive the per flux folder and the admin folder. And if you double click this file, this binary file, you'll notice that by default, it will open performance monitor with all of the counters in a single graph. Now, ideally, uh you want to examine this on a different computer. Uh What I like to do to make this file easier to analyze. For instance, with Microsoft Excel, I like to convert it to a comma delimited file. In order to do so you can use relo dot ex which is also a command line utility.
The command will look like this basically just type re lock dot exe and then specify the file that you want to convert from a binary file into a CS V comma the limited file. In this case, the one we just created using the Lockman tool and then forward slash O to specify an output and the path and name of the file that we want to have as a result. In this case, I've selected uh this path and this name finally the forward slash F parameter to indicate that we want a comma delimited file. A CS V as what the command, the re lock, the XC command would look like let's let's execute it after a brief wait again, you'll notice that you have a commodo limited file that is normally smaller in size than the binary that you just created. This file can now be transported and analyzed in with Microsoft Excel for instance with pivot tables and filters.
Now, uh finally, I'd like to show you how to see a list of all of the performance counters installed on a system by using the type perf tool to do so just type type the DXC and you can use the dash Q parameter and hit enter. This is a very long list as you can see. So you will most likely need to output it into a text file to fully scan it. Is this how you would do it? And you can take a look now at the resulting file and this would be a list of all of the installed performance counters on the particular system which you can then copy and uh use to construct your Loman dot exc command to collect the data that is more relevant to uh the case that you're troubleshooting. And this is how you can configure a data collector set to obtain performance logs using the command line. Of course, there are additional settings that you can use with these three commands. Documentation links are included in the video description.
Thank you very much for watching.