Share via


Store more data in StatsMan

So you've got a StatsMan instance running, and you think to yourself, "I have 64GB of memory but the StatsMan Redis instance is only using 16GB of that.  Why can't I tell StatsMan to keep more data?"

It turns out you can. I will now give you some important warnings:

Directly editing the configuration files may cause StatsMan to malfunction in unexpected ways, give you unexpected data results or simply not start at all. If you choose to edit the configuration files manually, be aware that the settings you change may not be retained in the event of an upgrade. Always backup the configuration file(s) you are editing before beginning any modifications.

OK, now that we have that out of the way...

The default value for maximum sample storage is 1440, which just so happens to be the number of minutes in a day.  Increasing or decreasing this default value will cause StatsMan to scale near linearly compared to the initial value.  So, if you go from 1440 to 2880, you will now store two days worth of information instead of one, and use approximately double the memory.  The inverse will be true if you go from 1440 to 720, you'll store only 12 hours of data but use half the memory.

We would recommend you run with the default value of 1440 with your full agent load to determine how the Listener server behaves normally, and then tweak slowly to make sure your installation remains stable.

So, enough reading, how do we actually make the change?

First I'll plug my favorite text editor, Visual Studio Code.  Sure, you can edit the file in Notepad, but why not edit in style?  Using VS Code will color code the file for you to make it much easier to edit.  You can download VS Code here.

Regardless of the editor, the file you need to edit is (default location):
  C:\Program Files\Skype for Business Server StatsMan Listener\PerfAgentListener.exe.config

Be sure to make a copy of this file before editing it.  Incorrectly editing the file will cause the service to fail to start.

Once you have the file open, search for the following configuration entry:
  <perfAgentListener redisService="localhost:6379" perfAgentListenerUriPrefixes="https://*:8443/">

Add a property to this xml node called redisMaxStoreSamples, setting the value in quotes to your desired point storage count:
  <perfAgentListener redisService="localhost:6379" perfAgentListenerUriPrefixes="https://*:8443/" redisMaxStoreSamples="2880">

Now save the file and restart the Skype for Business StatsMan Listener service.  Your new retention setting should take effect for each data series the next time a data point is saved for that series (typically within 1 minute of restarting the service).

We love feedback, let us know how it goes - we can be reached via the comments or on Twitter @SkypeStatsMan.