---
title: Configuring the HTTP connection pool
description: Optimize connections with external services by adjusting the number and duration of connections.
component: pingfederate
version: 13.0
page_id: pingfederate:performance_tuning_guide:pf_configuring_http_connection_pool
canonical_url: https://docs.pingidentity.com/pingfederate/13.0/performance_tuning_guide/pf_configuring_http_connection_pool.html
revdate: July 29, 2024
section_ids:
  about-this-task: About this task
  steps: Steps
---

# Configuring the HTTP connection pool

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

## About this task

PingFederate uses an HTTP connection pool to enable HTTP communication with external systems, including PingOne communication, LDAP gateways, some PingFederate adapters, and many other functions.

Most environments won't need to tune HTTP connection pool values.

If you find that you need to adjust timeout values, it might indicate issues with your network or overall capacity. You should investigate those configurations before you adjust these settings.

|   |                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| - | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | If you do need to tune the HTTP connection pool, you should adjust and test `max-connections` and `max-connections-per-route` first.Adjust `max-connections` to match the maximum `jetty-threads` value and `max-connections-per-route` to match the expected maximum external calls. For example, if you expect to have up to 200 threads using the PingOne API, set `max-connections-per-route` to 200.Test and adjust these values as necessary. |

## Steps

1. Open the `<pf_install>/pingfederate/server/default/data/config-store/http-connection-pooling-manager.xml` file.

2. Adjust the values as detailed in the following table:

   | 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 amount of time a connection in the pool can be idle before it is cleaned up in milliseconds.         |
   | `keepalive-timeout`         | `1000`        | The amount of time in milliseconds that a connection can idle before it is returned to the pool for use. |
   | `cleanup-delay-secs`        | `10`          | The delay in seconds before cleaning the HTTP client cache.                                              |

3. Save and close the file.

4. Restart PingFederate

5. For a clustered PingFederate environment, replicate the configuration to your other nodes. Learn more in [Replicating configurations](../administrators_reference_guide/pf_replicat_config.html).
