---
title: Configuring connection pools to datastores
description: Java Database Connectivity (JDBC) and LDAP datastores use connection pooling to improve the performance and efficiency of communicating with external systems. For optimal performance, a number of connections are required to handle most or all the requests in parallel.
component: pingfederate
version: 13.1
page_id: pingfederate:performance_tuning_guide:pf_config_connec_pool_to_datastor
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/performance_tuning_guide/pf_config_connec_pool_to_datastor.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: December 8, 2022
section_ids:
  about-this-task: About this task
  steps: Steps
---

# Configuring connection pools to datastores

Java Database Connectivity (JDBC) and LDAP datastores use connection pooling to improve the performance and efficiency of communicating with external systems. For optimal performance, a number of connections are required to handle most or all the requests in parallel.

## About this task

In the **Data & Credential Stores** page, set the minimum and maximum values for connection pools to JDBC and LDAP data stores.

Connection pools improve efficiency by maintaining persistent connections to the JDBC or LDAP server preventing the expense of creating the connection on demand. Connection pools also allow more control over the load placed on the back-end server. It might not be necessary to have a connection available for every concurrent request received by the server, but having too few available will cause requests to wait when accessing JDBC and LDAP resources.

|   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | Size the connection pool based on the capacity and limitation of the database or LDAP server. Sizing the connection pool beyond the capability of the back-end server could lead to PingFederate flooding the datastore without any performance improvement. For optimal performance, size connection pools large enough to handle between 50% and 100% of the number of concurrent requests the server is expected to encounter often. Learn more about optimizing the connection pool in [Best practices for tuning the JDBC connection pool](https://support.pingidentity.com/s/article/Best-practices-for-tuning-the-JDBC-Connection-Pool) in the Ping Identity Knowledge Base. |

## Steps

1. Choose from configuring connection pools to JDBC or LDAP datastores:

   | Datastore type                                  | Configuration steps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Configuring connection pools to JDBC datastores | 1. Go to **System > Data & Credential Stores > Data Stores**, and select the applicable JDBC datastore.

   2. Go to **Database Config > Advanced**.

   3. On the **Advanced Database Options** page:

      1. Set the **Minimum Pool Size** value to 50% of the `maxThreads` value.

      2. Set the **Maximum Pool Size** value to between 75% and 100% of the `maxThreads` value, subject to the capability of the back-end database server.&#xA;&#xA;The maxThreads value is defined in the \<pf\_install>/pingfederate/etc/run.properties file. Learn more in Tuning the server thread pool. |
   | Configuring connection pools to LDAP datastores | 1) Go to **System > Data & Credential Stores > Data Stores**, and select the applicable LDAP datastore.

   2) Go to the **LDAP Configuration > Advanced > Advanced LDAP Options**.

   3) Set the **Minimum Connections** value to 50% of the `maxThreads` value.

   4) Set the **Maximum Connections** value to between 75% and 100% of the `maxThreads` value, subject to the capability of the back-end database server.                                                                                                                                                                     |

2. For a clustered PingFederate environment, replicate the changes to all engine nodes on the **System > Server > Cluster Management** page.
