Profiling server performance using the Stats Logger
The PingDirectory server includes a built-in Stats Logger that is useful for profiling server performance for a given configuration.
At a specified interval, the Stats Logger can write server statistics to a JSON file or to a log file in a .csv
file, which can be read by spreadsheet applications. The logger has a negligible impact on server performance unless the log-interval
property is set to a value of less than 1 second. You can customize the statistics logged and their verbosity.
The Stats Logger can also be used to view historical information about server statistics, including:
-
Replication
-
LDAP operations
-
Host information
-
Gauges
To update the configuration of the existing Stats Logger Plugin, you can either:
-
Set the advanced
gauge-info
property tobasic/extended
to include this information. -
Create a dedicated Periodic Stats Logger for information about statistics of interest.
For information about how to enable this logging and where to find the log file, see Enabling the Stats Logger.
Enabling the Stats Logger
About this task
By default, the PingDirectory server’s built-in Stats Logger is disabled. To enable the Stats Logger:
Steps
-
Run
dsconfig
in interactive mode.When you are prompted, enter the LDAP or LDAPS connection parameters.
Example:
$ bin/dsconfig
-
To change to the
Advanced Objects
menu, entero
. -
On the main menu, enter the selection for
Plugins
. -
On the
Plugin
menu, enter the selection forView and edit an existing plugin
. -
From the
Plugin
selection list, enter the selection forStats Logger
. -
On the
Stats Logger Plugin
menu, enter the selection to set theenabled
property toTRUE
. To save and apply the configuration, enterf
.Result:
The default logger logs information about the server every second to
<server-root>/logs/dsstats.csv
. If the server is idle, nothing is logged.To change the idle logging behavior, set the
suppress-if-idle
property toFALSE
. -
Run the PingDirectory server.
Example:
For example, if you are running in a test environment, you can run the
search-and-mod-rate
tool to apply some searches and modifications to the server.To see an example command, run
search-and-mod-rate
--help
. -
View the Stats Logger output at
<server-root>/logs/dsstats.csv
.You can open the file in a spreadsheet.
Configuring multiple Periodic Stats Loggers
About this task
You can create multiple Periodic Stats Loggers to:
-
Log different statistics
-
View historical information about gauges
-
To create a log at different intervals, such as logging cumulative operations statistics every hour
To create a new log, use the existing Stats Logger as a template to get reasonable settings, including rotation and retention policy.
Steps
-
Run
dsconfig
in interactive mode.When prompted, enter the LDAP or LDAPS connection parameters.
Example:
$ bin/dsconfig
-
To change to the
Advanced Objects
menu, entero
. -
In the main menu, enter the selection for
Plugins
. -
In the
Plugin management
menu, enter the selection forCreate a new plugin
. -
To use an existing plugin as a template, in the
Create a New Periodic Stats Logger Plugin
menu, entert
. -
Enter the number corresponding to the existing stats logger as a template.
-
Enter a descriptive name for the new stats logger.
For this example, enter
Stats Logger-10s
. -
Enter the log file path to the file.
For this example, enter
logs/dsstats2.csv
. -
In the menu, make any other changes to the logger. To save and apply the configuration, enter
f
.Example:
For this example, change the
log-interval
to10s
, and thesuppress-if-idle
toFALSE
.
Result
You should see two loggers, dsstats.csv
and dsstats2.csv
, in the logs
directory.