opnsense / opnsense/plugins

www/nginx add a default value > 0 to ban_ttl to prevent UI slow down over time

Open
#4,577 16 comments 0 reactions 1 assignee View on GitHub

@kulikov-a is already working on this.

Since Sep 6, 2025.

cleanup
Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

Our opnsense instances have gotten slower and slower over time, we even got connection aborts as soon, as we logged into web UI. I spent quite some time googling for solutions, but without finding related issues like #3397. Last week, the UI of one instance got unusable, so I investigated further. It turned out, that one PHP process, ngx_autoblock.php put 100% load on all CPUs by running multiple times. After analyzing the script, I found out, that the banned IPs are written to config.xml, on this instance 50k entries. By googling for a way to remove all entries, I found the issues, describing ban_ttl and the configuration field under advanced settings.

Describe the solution you'd like

I would add a default value other that 0 to the ban_ttl field, as 0 means to keep the IPs forever in the ban list. I have set my instances to 2880 (two days) this reduces the list to round about 100 entries. One of the issues mentions a value of 120 minutes which will aslo work - every value is better than indefinite.

Adding a value to the ban_ttl field will remove older IPs from the list as soon, as you press Apply - it takes some time but it works. (hint for People searching for slow OPNsense UI)

Describe alternatives you've considered

I have also considered the "Unlock All"-button in UI that is described in #4087 but it would require manual intervention.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.