Perfmon Blackbox… more better :)

During a recent workshop in southern California I promised my students that I would update an old blog of mine that referenced how to create a blackbox perfmon data collector set. In the instructions I mentioned that the best way to get one of these running and keep it running all the time was to create a startup script. I have since found a better way. I credit my colleague Martin Vokurek with figuring out this neat little trick.

So, first you will want to create the blackbox data collector set and you can see how to do that in my original blog HERE. Afterword, you come back to this post and follow these easy steps.

Number 1… go to the computer management (Start –> right-click Computer –> click Manage)

image

Number 2… browse down to the “PLA” section of your Task Library (Server Manager –> Configuration –> Task Scheduler –> Task Scheduler Library –> Microsoft –> Windows –> PLA)

image

Number 3… in this list you’ll see your data collector set and if you don’t you need to enable the hidden tasks (view -> show hidden tasks)

Number 4… double click your data collector set to open its properties

Number 5… go to the triggers tab

Number 6… click on new and add “At Startup”

image

That’s it. You should now see the blackbox data collector set restart each and every time the system starts.

BUT

I also want to use this time to point out a strange behavior that’s been noticed. And it has to do with how perfmon interprets “append” and “circular logging” (or bincirc with is the binary circular logging format).

You basically have two choices, and it really comes down to that double dash in the –v (once again see HERE). With this on, perfmon will use the same filename (thus an actual blackbox) each time it restarts. Turn off the dash dash v and you’ll see it actually create a new file each time it restarts.

There are upsides and downsides to both approaches. If you WANT perfmon to always use the same file (and not risk ever accidentally consuming all the space on your drive with a bunch of 500mb log files) you’ll want to go with the --v option. The downside to this approach is that perfmon will clear out the log file and start fresh with a zero byte log. Meaning if your server reboots you’ll not have any perf data from the previous session.

If you want to keep the file just don’t use the v option. And keep an eye on that disk space. Because what will happen is perfmon will simply create a new blackbox after each restart so you can go back through the previous blg file.