---
title: Configuring the placement algorithm using a batch file
description: Configure a PingDirectoryProxy entry-count placement algorithm using the dsconfig.post-setup batch file to replace the default round-robin placement algorithm.
component: pingdirectory
version: 11.1
page_id: pingdirectory:pingdirectoryproxy_server_administration_guide:pd_proxy_config_placement_alg_batch_file
canonical_url: https://docs.pingidentity.com/pingdirectory/11.1/pingdirectoryproxy_server_administration_guide/pd_proxy_config_placement_alg_batch_file.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
section_ids:
  about-this-task: About this task
  steps: Steps
  example: Example:
  result: Result:
---

# Configuring the placement algorithm using a batch file

Configure the placement algorithm using a batch file.

## About this task

You want to place new entries added through the proxy using LDAP `ADD` operations into the least used dataset. Do this using an entry-count placement algorithm. To change the placement algorithm from round-robin to entry-count, first create and enable an entry-count placement algorithm configuration object, and then disable the existing round-robin placement algorithm. The batch file, `dsconfig.post-setup`, contains the `dsconfig` commands required to create the entry-count placement algorithm and disable the old round-robin algorithm.

The batch file contains comments to explain each `dsconfig` command.

|   |                                                                                                                                         |
| - | --------------------------------------------------------------------------------------------------------------------------------------- |
|   | In this example, line wrapping is used for clarity. The `dsconfig` command requires that the full command be provided on a single line. |

The batch file itself looks like the following.

```
root@austin-proxy1:more ../dsconfig.post-setup

# This dsconfig operation creates the entry-count placement
# algorithm with the default behavior of adding entries to the
# smallest backend dataset first.

dsconfig create-placement-algorithm
--processor-name ou_people_dc_example_dc_com-eb-req-processor
--algorithm-name entry-count --type entry-counter --set enabled:true

# Note that once the entry-count placement algorithm is created
# and enabled, we can disable the round-robin algorithm.
# Since an entry-balancing proxy must always have a placement
# algorithm, we add a second algorithm and then disable the
# original round-robin algorithm created during the setup
# procedure.

dsconfig set-placement-algorithm-prop
--processor-name ou_people_dc_example_dc_com-eb-req-processor
--algorithm-name round-robin --set enabled:false

# At this point, LDAP ADD operations will be forwarded to an external
# server representing the dataset with the least number of entries.
```

## Steps

* Run the `dsconfig` command using the batch file.

  ### Example:

  ```
  root@austin-proxy1: bin/dsconfig --no-prompt \
  --bindDN "cn=directory manager" --bindPassword password \
  --port 389  --batch-file ../dsconfig.post-setup
  ```

  ### Result:

  After the batch file has executed, a new entry-count placement algorithm, called `entry-count`, has been created and the old round-robin placement algorithm, `round-robin`, has been disabled.

  ```
  Batch file '../dsconfig.post-setup' contains 2 commands

  Executing: create-placement-algorithm --no-prompt
  --bindDN "cn=directory manager" --bindPassword pass
  --port 1389
  --processor-name ou_people_dc_example_dc_com-eb-req-processor
  --algorithm-name entry-count --type entry-counter --set enabled:true

  Executing: delete-placement-algorithm --no-prompt
  --bindDN "cn=directory manager" --bindPassword pass
  --port 1389
  --processor-name ou_people_dc_example_dc_com-eb-req-processor
  --algorithm-name round-robin --set enabled:false
  ```
