# Performance tweaks

Multiple approaches can be used to tweak the agent performance and resources usage.

## Reverse proxy threads [Permalink to this section](/content/documentation/agent-documentation/performance-tweaks#reverse-proxy-threads "Permalink to this section"/index.html)

As a reverse proxy, the redirection.io agent can handle a large number of requests, and it can be configured to optimize its performance in different ways. For example, you can configure the agent to use a specific number of worker processes, to enable or disable the use of HTTP/2 for backend connections, etc.

[View in configuration explorer](/content/documentation/agent-documentation/examples/performance-tuning/index.html)

```yaml
instance:
    name: 'My Instance'everse_proxy:
    listen:
        - 'tcp://0.0.0.0:80'
    forward:
        address: 'backend:8080'
    agent:
        project_key: my-project-key
    server_threads: 1
    worker_threads: 4
    worker_max_blocking_threads: 1024
```

The following configuration directives can be used to tweak the performance of the agent:

- `server_threads` (default: `1`): the number of threads to use for handling incoming requests. By default, the agent uses a single thread for handling incoming requests, but you can increase this number to improve the performance of the agent when handling a large number of concurrent requests.
- `worker_threads`: the number of threads to use for handling the requests processing and forwarding to the backend. By default, the agent uses a number of worker threads equal to the number of CPU cores available, so there should be no need to configure this option in most cases.
- `worker_max_blocking_threads` (default: `1024`): the maximum number of threads to use for handling blocking operations.

## Memory consumption [Permalink to this section](/content/documentation/agent-documentation/performance-tweaks#memory-consumption "Permalink to this section"/index.html)

Other configuration directives can be used to limit the memory consumption. See this example:

[View in configuration explorer](/content/documentation/agent-documentation/examples/limiting-the-memory/index.html)

```yaml
instance:
    name: 'My Instance'
    cache: 10000
    max_logs_buffer_size: 20000
reverse_proxy:
    listen:
        - 'tcp://0.0.0.0:80'
    forward:
        address: '127.0.0.1:8080'
    agent:
        project_key: my-project-key
```

In this example, [the `cache` directive](/content/documentation/agent-documentation/agent-configuration-reference#cache/index.html) limits the number of compiled regular expressions that are stored in memory (for matching requests in a performant way), and [`max_logs_buffer_size`](/content/documentation/agent-documentation/agent-configuration-reference#max-logs-buffer-size/index.html) limits the maximum number of logs that can be buffered in memory before being sent to the redirection.io platform (setting this to a very high value will use more memory if a lot of logs are collected in a short period).

## Monitoring the performance [Permalink to this section](/content/documentation/agent-documentation/performance-tweaks#monitoring-the-performance "Permalink to this section"/index.html)

Remember that you're not blind when using the redirection.io agent! We offer [ways to monitor the agent](/content/documentation/agent-documentation/monitoring-the-agent/index.html) and check that it is working correctly.

This page has been updated on Mar 30, 2026

Can't find your answer?

[Contact our support](/content/contact/index.html)
