---
title: Tuning data collection
description: You can tune data collection by reducing the data collected, reducing the frequency of data collection, reducing the frequency of sample block creation, and reducing PingDataMetrics server impact on performance.
component: pingdirectory
version: 9.3
page_id: pingdirectory:pingdatametrics_server_administration_guide:pd_met_tune_data_collection
canonical_url: https://docs.pingidentity.com/pingdirectory/9.3/pingdatametrics_server_administration_guide/pd_met_tune_data_collection.html
revdate: September 13, 2023
section_ids:
  reducing-the-data-collected: Reducing the data collected
  example: Example
  reducing-the-frequency-of-data-collection: Reducing the frequency of data collection
  about-this-task: About this task
  steps: Steps
  example-2: Example:
  result: Result:
  reducing-the-frequency-of-sample-block-creation: Reducing the frequency of sample block creation
  about-this-task-2: About this task
  steps-2: Steps
  reducing-pingdatametrics-server-impact-on-performance: Reducing PingDataMetrics server impact on performance
  about-this-task-3: About this task
  steps-3: Steps
  result-2: Result:
---

# Tuning data collection

You can tune data collection by reducing the data collected, reducing the frequency of data collection, reducing the frequency of sample block creation, and reducing PingDataMetrics server impact on performance.

Collecting all of the performance data at the most granular level from all of the servers might not be possible without a significant investment in hardware for the PingDataMetrics server. Instead, tune data collection to fit within the limits of the existing PingDataMetrics server hardware.

The remainder of this section describes several strategies for tuning data collection.

## Reducing the data collected

If not all information collected by the PingDataMetrics server is required, the Stats Collector plugin's entry-cache property can be tuned using the `dsconfig` command-line tool.

The server collects information for eight different information groups. Limit data collection to the devices of actual interest.

### Example

To omit all metrics related to the entry cache, set the `entry-cache-info` group on the monitored server:

```shell
$ bin/dsconfig set-plugin-prop --plugin-name "Stats Collector" \
  --set entry-cache-info:none
```

## Reducing the frequency of data collection

Use the `dsconfig` tool to reduce or modify the frequency of data collection in the monitored servers.

### About this task

Monitored servers can produce metric samples every second, which is useful for short-duration changes. These samples are less useful hours later, after the per-second data is aggregated to per-minute data.

### Steps

* To change the base sample production rate from the default of 1 second to 10 seconds, use the `dsconfig` tool.

  #### Example:

  ```shell
  $ bin/dsconfig set-plugin-prop --plugin-name "Stats Collector" \
    --set "sample-interval:10 seconds"
  ```

  #### Result:

  This change reduces the total data volume by about 90 percent.

## Reducing the frequency of sample block creation

Reduce the number of sample blocks processed by the PingDataMetrics server.

### About this task

By default, the monitored servers produce a new block of samples every 30 seconds. Increasing this to 60 seconds, while reducing the PingDataMetrics server's polling rate to 60 seconds, reduces the sample processing overhead.

### Steps

* To change the frequency at which the monitored servers create sample blocks, run the following `dsconfig` command:

  ```shell
  $ bin/dsconfig set-backend-prop --backend-name metrics \
    --set sample-flush-interval:60s
  ```

## Reducing PingDataMetrics server impact on performance

All Ping Identity servers expose performance data through the `cn=monitor` distinguished name (DN).

### About this task

Performance issues occur when data is read, either directly by an LDAP client, or by enabling either the Stats Logger or Stats Collector plugins.

The Stats Logger plugin reads the configured monitors and writes the resulting values to a `.csv` file. The Stats Collector plugin also reads the configured monitors and writes the resulting values to a `.csv` file, but this file is made available for LDAP clients in `cn=metrics` DN. The Stats Collector `.csv` files are suitable for use by the PingDataMetrics server, and contain one metric value per line.

The Stats Logger and the Stats Collector plugins are both disabled by default. When enabled, each of these plugins adds an approximate 3% CPU utilization penalty, plus a negligible amount of disk I/O and Java virtual machine (JVM) heap usage.

### Steps

* To enable the Stats Collector plugin, run the following `dsconfig` command:

  ```shell
  $ bin/dsconfig set-plugin-prop --plugin-name "Stats Collector" \
    --set enabled:true
  ```

  #### Result:

  The `monitored-servers` tool enables the Stats Collector plugin on the monitored server.
