How Do We Love Performance Counters? Let Us Count the Ways


 

 

If you happen to be up on your poetry (as those of us here at the Lync Server PowerShell blog, the home of the daily Lync Server PowerShell haiku, obviously are) then you are no doubt familiar with the poem How Do I Love Thee? by Elizabeth Barrett Browning. And even if you aren’t up on your poetry (for shame!) then you’re probably still familiar with the poem’s opening lines:

 

How do I love thee? Let me count the ways.

I love thee to the depth and breadth and height

My soul can reach, when feeling out of sight

For the ends of Being and ideal Grace.

 

After that opening stanza, Browning goes on to list all the ways that she loves thee, which seems to be about 8 different ways. (To tell you the truth, we kind of lost count as we were reading.) At any rate, How Do I Love Thee? is considered by many people to be the most romantic poem ever written. a judgment that we really can’t argue with, even though we do expect that, over time, our very own haiku #2 will eventually be considered the most romantic poem ever written:

 

The elephant missed

His plane. He forgot his trunk

Configuration.

 

But, admittedly, it might be a while before that happens.

 

English professors will tell you that Elizabeth Barrett Browning was one of the greatest poets of all time. But here’s something that those academic eggheads won’t tell you: Elizabeth Barrett Browning would have been a terrible Microsoft Lync Server 2010 administrator. How can we say that? Well, for one thing, Elizabeth Barrett Browning was born in 1801 and people born during that era have never really made much of a splash as Lync Server administrators.

 

Note. She also suffered from nervous hysteria and was addicted to morphine, things which are rarely mentioned in ads for Lync Server administrators:

 

WANTED: Experienced Lync Server administrator. Applicants must suffer from nervous hysteria and be addicted to morphine. Non-smokers only.

 

Perhaps more important, however, is the fact that Elizabeth Barrett Browning was hopelessly inefficient. Consider How Do I Love Thee? In that poem, Browning laboriously lists each and every way that she loves her soon-to-be-husband Robert Browning. That approach might have worked back in the 1800s; after all, without TV, Twitter, or Facebook people didn’t really have anything to do anyway. But in today’s hectic, high-paced world no one has the time to tediously count up all the ways that they love someone. Do you have any idea how many Facebook pokes you might miss while counting up all the ways that you love someone? Exactly.

 

And that’s why Elizabeth Barrett Browning would make such a lousy Lync Server administrator. For example, suppose Elizabeth Barrett Browning needed to know how many incoming SIP messages had been received on a Front End server. No doubt she would sit there and count those messages one-by-one: “Here’s one from Ken Myer. And here’s one from Pilar Ackerman. Oh, and here’s another one from Ken Myer.” Is that the way a good Lync Server administrator would do this? Hardly. Instead, a good Lync Server administrator would do this:

 

Get-Counter -Counter “LS:SIP – 02 – ProtocolSIP – 000 – Incoming Messages” | Select-Object –ExpandProperty CounterSamples | Select-Object CookedValue

 

And if you’re thinking “That’s cool, but what exactly is that?” well, have no fear: that (using Windows PowerShell to work with Lync Server performance counters) just happens to be the topic of this article.

 

Note. Hey, you had to figure we’d get to the topic sooner or later, right?

 

 

Lync Server Performance Counters

 

We’re assuming that everyone out there is already familiar with performance counters but, just in case, here’s a quick overview. Performance counters are values that can be used to analyze the usage and/or the health of an application (or of the operating system, for that matter). For example, Lync Server 2010 ships with hundreds of performance counters: there are performance counters for the Response Group application, performance counters for the Call Park Service, performance counters for CAA, CAS, PDP, QMS, and pretty much any Lync Server acronym you can think of. And the best part is that you don’t need to do anything to implement these counters: performance counters are installed when you install Lync Server, and, once they are installed, Lync Server takes care of continually updating those counters. The only thing you have to do is occasionally check the values of your performance counters. And if you don’t know how to do that, well, just keep reading.

 

Wait: one quick caveat before you keep reading. Keep in mind that this is not a detailed description on the performance counters that ship with Lync Server 2010, nor does it offer any insights on which Lync Server performance counters you might find the most useful. After all, we’re PowerShell guys, which means that all we can do is show you how to use Windows PowerShell to access performance counters. (And that means any performance counter, not just Lync Server performance counters.) Explaining what each performance counter does, and explaining why you might be interested in using a given performance counter, lies a bit outside our area of expertise.

 

Note. So what lies inside the area of our expertise? Well, um, there’s, uh – say, could we hold all questions until the end, please? Thank you.

 

Speaking of questions, let’s start with an obvious one: what performance counters are available for Lync Server, and how can we get a list of those counters? To begin with, we should point out that individual performance counters are collected in performance counter sets. For example, Lync Server includes a set of performance counters named this:

 

·         LS:RGS – 00 – Response Group Service Hosting

 

Inside that set, you’ll find the following individual performance counters:

 

·         RGS – 000 – Total number of incoming calls that were declined because of a Match Making failure

·         RGS – 001 – Total number of different workflows loaded in memory

·         RGS – 002 – Total number of different application endpoints

·         RGS – 003 – Total number of failures when binding to the Collaboration Platform

·         RGS – 004 – Total number of failures when binding Match Making to WCF

·         RGS – 005 – Total number of application endpoint binding failures

·         RGS – 006 – Total number of certificate validation failures

·         RGS – 007 – Total number of successful certificate validations

·         RGS – 008 – Total number of application endpoint terminations

·         RGS – 009 – Duration of the call in milliseconds

 

Is that important? As a matter of fact, it’s very important: when we refer to an individual performance counter we’ll have to specify a path that includes both the name of the counter set and the name of the performance counter. For example, here’s a path that shows the counter set name in red and the counter name in blue:

 

·         LS:RGS – 00 – Response Group Service HostingRGS – 001 – Total number of different workflows loaded in memory

 

That’s what we thought, too: pretty as a picture.

 

OK, let’s now see if we can get a list of all the performance counter sets for Lync Server 2010. (Note that we’re going to start off by doing everything locally; that is, on a computer currently running one or more Lync Server services or server roles. We’ll talk about performing these same tasks on remote computers later on.) Are we concerned that we won’t be able to retrieve this information? On the contrary; we’re extremely confident that we will be able to retrieve this information, and for two reasons:

 

·         Windows PowerShell 2.0 includes the Get-Counter cmdlet, which makes it easy to retrieve performance counter information.

·         Lync Server’s performance counter sets all use a standard naming convention: each set name begins with the characters LS:.

 

Why does that make us co confident? That’s easy: that means that we can use a command like this one to return a list of all of Lync Server’s performance counter sets:

 

Get-Counter -ListSet “LS:*”

 

As you can see, that’s not a very complicated command, to say the least. All we do is call the Get-Counter cmdlet followed by the ListSet parameter (as the name implies, this asks Get-Counter to return a list of performance counter sets). The parameter value passed to ListSet is nothing more than a good old-fashioned wildcard value: “LS:*” which, as you already know, simply says “Show me all the counter sets that begin with the string value LS:.” And remember, this same approach works with all performance counters and performance counter sets, not just with Lync Server-related counter sets. Are there any performance counter sets that work with disk drives? Well, try running this command and see for yourself:

 

Get-Counter -ListSet “*Disk*”

 

Note. And, of course, you can run the following command to return information about all your performance counter sets:

 

Get-Counter -ListSet “*”

 

So will we get back any information when we run the command Get-Counter -ListSet “LS:*”? You might say that. On our test computer (a Front End Server) we got back information for 142 different performance counter sets, with each set returning data similar to this:

 

CounterSetName     : LS:SipEps – 02 – SipEps Connections

MachineName        : .

CounterSetType     : MultiInstance

Description        : This object includes counters that apply to Lync Server

                     IPEPS stack

Paths              : {LS:SipEps – 02 – SipEps Connections(*)SipEps – 000 –

                     Bytes Received, LS:SipEps – 02 – SipEps

                     Connections(*)SipEps – 001 – Bytes

                     Received/sec, LS:SipEps – 02 – SipEps      

                     Connections(*)SipEps – 002 – Bytes Sent, LS:SipEps –

                     02 – SipEps Connections(*)SipEps – 003 – Bytes Sent/sec…}

PathsWithInstances : {LS:SipEps – 02 – SipEps Connections(_Total)SipEps –

                     000 – Bytes Received, LS:SipEps – 02 – SipEps

                     Connections(server.3528_mediationserversvc_appdom_1)

                     SipEps – 000 – Bytes Received, LS:SipEps – 02 – SipEps

                     Connections(server.3240

                     _ocsappserverhost_appdom_2)SipEps – 000 – Byte

Comments (6)
  1. Anonymous says:

    The (*) needs to be replace with something (I don't know the proper name, instance maybe).

    get-counter "LS:SIP – 01 – Peers(Clients)SIP – 000 – Connections Active"

    get-counter "LS:SIP – 01 – Peers(_Total)SIP – 000 – Connections Active"

    get-counter "LS:SIP – 01 – Peers(YourPoolName)SIP – 000 – Connections Active"

    To see them all try the following and look at the PathsWithInstances values.

    Get-Counter -ListSet "LS:SIP – 01 – Peers"

  2. thirdrock111 says:

    Hi,

    I ran the following from a front end server to determine active connections…

    Get-Counter –Counter "LS:SIP – 01 – Peers(*)SIP – 000 – Connections Active" | Select-Object –ExpandProperty CounterSamples | Where-Object {$_.InstanceName –eq "clients"}

    and received the following error…

    Get-Counter : The specified object was not found on the computer.

    At line:1 char:12

    + Get-Counter <<<<  -Counter "LS:SIP – 01 – Peers(*)SIP – 000 – Connections A

    ctive" | Select-Object -ExpandProperty CounterSamples | Where-Object {$_.Instan

    ceName -eq "clients"}

       + CategoryInfo          : InvalidResult: (:) [Get-Counter], Exception

       + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.Ge

      tCounterCommand

    Thanks.

    1. anonymous says:

      Try (Lync13)
      Get-Counter -counter “\LS:SIP – Peers(*)\SIP – Connections Active” ……

  3. Anonymous says:

    Pingback from Cooking With Performance Counters.. | systemsadministrator101

  4. Groovedoctor says:

    Thank you for this!!! much appreciated! best of luck with poetry!

  5. keatho says:

    Hi,

    Is there a way to reset Lync performance counters? For Example – LS:SIP – Peers_TotalSIP – Sends Outstanding

Comments are closed.

Skip to main content