---
title: Priming the global indexes on startup
description: Prime the PingDirectoryProxy global indexes at startup from a backend server or peer proxy to avoid WAN bandwidth consumption and reduce processing load.
component: pingdirectory
version: 11.1
page_id: pingdirectory:pingdirectoryproxy_server_administration_guide:pd_proxy_prime_global_indexes_on_startup
canonical_url: https://docs.pingidentity.com/pingdirectory/11.1/pingdirectoryproxy_server_administration_guide/pd_proxy_prime_global_indexes_on_startup.html
llms_txt: https://docs.pingidentity.com/pingdirectory/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: September 13, 2023
page_aliases: ["pd_proxy_config_all_indexes_at_startup.adoc", "pd_proxy_config_global_indexes_manually.adoc", "pd_proxy_persist_global_index_from_file.adoc"]
section_ids:
  configuring-all-indexes-at-startup: Configuring all indexes at startup
  steps: Steps
  example: Example:
  configuring-the-global-indexes-manually: Configuring the global indexes manually
  about-this-task: About this task
  steps-2: Steps
  example-2: Example:
  example-3: Example:
  persisting-the-global-index-from-a-file: Persisting the global index from a file
  about-this-task-2: About this task
  steps-3: Steps
  example-4: Example:
---

# Priming the global indexes on startup

The PingDirectoryProxy server can prime the global indexes at startup from the backend directory server or from a peer proxy server, preferably one that resides on the same LAN or subnet.

When priming occurs locally, you can avoid WAN bandwidth consumption and reduce the processing load on the directory servers in the topology. You can specify the data sources for the index priming and the order in which priming occurs from these sources. Use the `prime-index-source` property to specify the sources of data, either `ds`, `file` or some combination of the two.

The order you specify is the order in which priming is attempted from these sources. Priming is most efficient if the source server is on the same local network as the PingDirectoryProxy server.

For example, if you specify `prime-index-source:file,ds`, priming is performed from the `global-index` data file created from the previous run of the directory servers. If the entire global index has been primed previously from a startup or reloaded-index directory server's source, the contents of the global index are written to disk periodically with the `file,ds` configuration.

## Configuring all indexes at startup

### Steps

* To prime all indexes at startup, run the `dsconfig` tool.

  #### Example:

  The following example configures the entry-balancing request processor so that it primes the global index from the persisted file, if present, or from an external directory server's source, if necessary.

  ```shell
  $ bin/dsconfig set-request-processor-prop \
    --processor-name dc_example_dc_com-eb-req-processor \
    --set prime-all-indexes:true --set prime-index-source:file \
    --set prime-index-source:ds
  ```

## Configuring the global indexes manually

### About this task

If you don't want to configure priming during setup, you can configure the index priming manually.

To do this, create an external server, create a global attribute index, and change the entry-balancing request processor to load indexes from the external server.

### Steps

1. To create an external server of the PingDirectoryProxy type to represent a peer of the PingDirectoryProxy server, use the `dsconfig` tool with the `create-external-server` subcommand.

   #### Example:

   ```shell
   $ bin/dsconfig create-external-server \
     --server-name intra-proxy-host.example.com:3389 \
     --type PingDirectoryProxy-server \
     --set server-host-name:intra-proxy-host \
     --set server-port:338 \
     --set "bind-dn:cn=Directory Manager" \
     --set "password:secret123"
   ```

2. Create a global attribute index on the `uid` attribute.

   #### Example:

   ```shell
   $ bin/dsconfig create-global-attribute-index \
     --processor-name dc_example+dc+com-eb-req-processor \
     --index-name uid \
   ```

3. To load the indexes at startup from the peer PingDirectoryProxy server, change the entry-balancing request processor using `dsconfig set-request-processor-prop`.

## Persisting the global index from a file

### About this task

The PingDirectoryProxy server supports periodically persisting the global index to a file and priming the global index from the persisted file when the server is restarted.

You can configure an Entry Balancing Request Processor to persist the global index to disk periodically so that when the Entry Balancing Request Processor is reinitialized on startup it can prime the values from disk instead of putting load on the remote servers. Reading the index from disk eliminates the load on backend PingDirectory server instances if many PingDirectoryProxy server instances are starting at the same time.

You can configure an entry-balancing request processor to persist the global index to disk by including `file` as one of the prime index sources with the `prime-index-source` property. The `persist-global-index-frequency` property controls the frequency at which the file is written.

The global index must be primed before it's persisted. It can be primed initially using a peer PingDirectoryProxy server or from a backend PingDirectory server.

When new global attribute indexes are added on a running PingDirectoryProxy, the global index can be primed with those attribute indexes by running the `rebuild-index` tool. The `rebuild-index` tool uses a remote server for priming the global index, even if `file` is configured as a source.

On subsequent restarts of the PingDirectoryProxy server, the global index is primed from the persisted file instead of going over the network to a remote server, which allows it to be primed much faster than if it's using a remote priming source. During server startup, the global index priming works by using each configured `prime-index-source` property in the specified order until it's fully primed to take advantage of what is available locally before contacting one or more remote servers.

### Steps

* To prime all indexes at startup from a file, run the `dsconfig` tool.

  #### Example:

  ```
  dsconfig -n set-request-processor-prop \
    --processor-name entry-balancing \
    --set prime-index-source:file \
    --set prime-index-source:ds \
    --set persist-global-index-frequency:10s \
    --set persist-global-index-directory:/servers/proxy-1/index-files \
    --set prime-all-indexes:true
  ```
