Advanced Information on Disk Usage Gathering in Reporting & Monitoring Server

  • 7019417
  • 27-Jan-2015
  • 07-Aug-2017

Environment


Retain 3.4 and newer
Reporting & Monitoring Server
Disk Usage Stats

Situation


I hear that the new Reporting & Monitoring feature includes a process that gathers the disk usage consumed by each mailbox, etc.  How does it go about doing this?

Resolution


The disk usage utility runs on the Retain Server, even if the Reporting & Monitoring Server is running on a different server

The utility is launched a few minutes after Retain startup, but it does not do anything if the Reporting & Monitoring Server is not configured.  In the ../RetainStatsServer/WEB-INF/cfg/StatsConfiguration.cfg, you'll see a line that reads "initialized = [value]".  If the value is "False", then it is not configured, "True" means it is configured.  Deleting the StatsConfiguration.cfg and restarting Tomcat would also prevent the disk usage utility from running.
Logging
If your RetainServer log is set to diagnostic logging (Configuration | Server Configuration | Logging), you'll see something like this:
"DirectorySizeService: Counting directories for up to 60 seconds."

and

"DirectorySizeService: Exiting with [number] remaining directories; counted [number]
"
Runtimes
It runs automatically every 15 minutes or at the "update interval for server statistics" as defined on the Core Settings tab of the Reporting and Monitoring configuration screen.

It runs for one minute at a time in order to avoid constant high server resource utilization.  It divides the archive directory into to 65,536 subdirectories to do its count, which means that it is starting at the second of three levels in the archive directory hierarchy (see "Where Data Is Stored In Retain").  When the RetainServer log shows "...; counted [number]", that's the number it counted within those 60 seconds; and, that number represents all the subdirectories below it. 

For each of these subdirectories, it locates all the files in the directory and sums the file sizes.  It could run longer than a minute if processing one of the 65,536 subdirectories takes longer takes longer than a minute (remember, those 65,536 directories each have 256 subdirectories containing the actual archive files themselves, so there is a lot of work to do in just a minute).

Between each minute-long run of activity, it pauses a minimum of 10 minutes, but the exact time is configured in the R&M configuration, "Update interval for Server Statistics (minutes)" and by the automatic run every 15 minutes.  Thus, if it gets launched due to the automatic 15 minute rule and then the "update interval" kicks in 5 minutes later, it will not run because it has to pause a minimum of 10 minutes.  If it ran 11 minutes ago and the update interval kicks in, then it will run.

It will do this regardless of whether an archive job is running.

If Tomcat is restarted, then the utility begins at the beginning of the directories rather than picking up where it left off.

Additional Information

This article was originally published in the GWAVA knowledgebase as article ID 2451.