# Set the topology filtering limit

## Overview

To optimize performance, a limit is placed on the amount of elements that can be loaded to produce a topology visualization. The filtering limit has a default value of 10000 elements.

If a [topology filter](https://archivedocs.stackstate.com/5.1/use/stackstate-ui/filters) loads more components than specified in the filtering limit, a message will be displayed on screen and no topology visualization will be displayed.

{% hint style="info" %}
The filtering limit is applied to the total amount of elements that need to be **loaded** and not the amount of elements that will be displayed.
{% endhint %}

## Configure default filtering limit

If required, the default filtering limit can be manually configured.

{% tabs %}
{% tab title="Kubernetes" %}
To set a custom filtering limit, add the following to the `values.yaml` file used to deploy StackState:

{% code lineNumbers="true" %}

```yaml
stackstate:
  components:
    api:
      config: |
         stackstate.webUIConfig.maxStackElementCount = <newvalue>

stackstate:
  components:
    view-health:
      config: |
         stackstate.webUIConfig.maxStackElementCount = <newvalue>
```

{% endcode %}
{% endtab %}

{% tab title="Linux" %}
Set a custom filtering limit in `etc/application_stackstate.conf` using the parameters `stackstate.webUIConfig.maxStackElementCount` and `stackstate.topologyQueryService.maxStackElementsPerQuery`.
{% endtab %}
{% endtabs %}
