The 9z, by Chris Davis

An Active Directory, Windows Platform, Performance troubleshooting (and anything else interesting I run across) BLOG.

Perfmon Blackbox… more better :)

Perfmon Blackbox… more better :)

  • Comments 3
  • Likes

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.

Comments
  • Hi, can this be done by specifying a limit size?

    I am trying to monitor a random issue with no pattern and would like to stop recording the log from being recorded when issue happens. This will tell me what happened in the period prior to event.

    Thanks,  Petru

  • Yes if you go to the initial article that spawned this secondary one (link is above) you'll see in the command line that created the counters, there is a "max 500" which can also be edited from the perfmon GUI. This limits the output to 500MB. As to stopping the log at a particular threshold, no. Perfmon isn't able to do that. You could create this in tandem with an event trigger or a perfmon alert.

  • Hey thanks! This helped a bunch.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment