---
title: Configuring HTTP connection pools
description: Optimize connections with external services by adjusting the number and duration of connections.
component: pingfederate
version: 13.1
page_id: pingfederate:performance_tuning_guide:pf_configuring_http_connection_pool
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/performance_tuning_guide/pf_configuring_http_connection_pool.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
section_ids:
  about-this-task: About this task
  steps: Steps
  http-connection-pool-settings: HTTP connection pool settings
---

# Configuring HTTP connection pools

Optimize connections with external services by adjusting the number and duration of connections.

## About this task

PingFederate uses an HTTP connection pool to communicate with external systems, including PingOne communication, Lightweight Directory Access Protocol (LDAP) *(tooltip: \<div class="paragraph">
\<p>An open, cross platform protocol used for interacting with directory services.\</p>
\</div>)* gateways, some PingFederate adapters, and many other functions.

Most environments don't need to tune HTTP connection pool values. Before you adjust timeout values, first investigate network latency, external-system capacity, and overall environment sizing.

If you tune the HTTP connection pool, adjust and test `max-connections` and `max-connections-per-route` first.

Use `pf.runtime.threads.max` as the starting point for sizing HTTP connection pools, represented as `M`. Because PingFederate maintains persistent connections, set `max-connections-per-route` to `M`. If the busiest flow can call `D` external destinations, set `max-connections` to `M × D` as a worst-case starting point. This helps prevent one high-volume route from delaying other routes.

In a clustered environment with `P` PingFederate engines, an external system might need up to `P × M` concurrent connections. Before you increase these values, verify that the external system can handle the concurrent load. Size the pool according to the capacity and limits of the back-end system, because increasing pool sizes beyond back-end capacity can increase load without improving performance.

Also ensure that the PingFederate host environment can support the additional resource usage, including open file limits and thread stack settings. Thread memory usage varies by operating system, architecture, and runtime behavior, so avoid assuming a fixed per-thread amount. When you scale connection pools, consider the cumulative committed-memory impact of many concurrent threads and datastore *(tooltip: \<div class="paragraph">
\<p>A database or directory location containing user account records and associated user attributes.\</p>
\</div>)* operations. If memory demand grows beyond available system memory, the operating system might terminate the process.

Learn more about sizing `pf.runtime.threads.max` in [Tuning the server thread pool](pf_tuning_server_thread_pool.html), and learn more about connection pool behavior and back-end capacity in [Configuring connection pools to datastores](pf_config_connec_pool_to_datastor.html).

## Steps

1. In a text editor, open the `<pf_install>/pingfederate/server/default/data/config-store/http-connection-pooling-manager.xml` file.

2. Modify the appropriate setting in `http-connection-pooling-manager.xml`. Refer to the HTTP connection pool settings table for more information.

3. (Optional) Update an HTTP connection pool setting by using a REST request to the PingFederate administrative API. Learn more in [Accessing the API interactive documentation](../developers_reference_guide/pf_access_api_interact_documentation.html).

4. If you updated the file directly, save and close the file.

5. Restart PingFederate.

6. For a clustered PingFederate environment, perform these steps on the administrative console node. Then go to **System > Server > Cluster Management** and click **Replicate**. Learn more in [Replicating configurations](../administrators_reference_guide/pf_replicat_config.html).

## HTTP connection pool settings

The `http-connection-pooling-manager.xml` file contains the following HTTP connection pool settings:

| Setting                     | Default value | Description                                                                                         |
| --------------------------- | ------------- | --------------------------------------------------------------------------------------------------- |
| `max-connections`           | `350`         | The maximum number of connections in the pool.                                                      |
| `max-connections-per-route` | `100`         | The maximum number of connections per route (port or URL).                                          |
| `connection-timeout`        | `60000`       | The time, in milliseconds, available to establish a connection with the remote host.                |
| `request-timeout`           | `120000`      | The time, in milliseconds, available to retrieve a connection from the connection pool.             |
| `connection-idle-timeout`   | `30000`       | The time, in milliseconds, that a connection can stay idle before cleanup.                          |
| `keepalive-timeout`         | `1000`        | The time, in milliseconds, that a connection can stay idle before it returns to the pool for reuse. |
| `cleanup-delay-secs`        | `10`          | The delay, in seconds, before the HTTP client cache is cleaned up.                                  |
