#5538·frp

[Feature Request] Configurable traffic counter update interval for active connections

Author: gregor-tokarevCreated Sep 11, 2026Updated Sep 11, 2026

Describe the feature request

We use frp in production and alert when traffic approaches our nodes' throughput limits. We need the proxy names in frp's metrics to group traffic and link it to our own data.

For long-lived TCP connections, the traffic counters stay unchanged until the connection closes, then jump. Having Prometheus scrape more often doesn't help. This was also reported in #5282 and #4651, with a request for live statistics in #4673.

Could we add an optional setting in frps.toml, something like:

trafficStatsUpdateIntervalSeconds = 0

The default, 0, would keep updating counters on connection close. Setting it to 5 would also update counters for active connections every five seconds. We'd use an interval of two to five seconds for our alerts.

Each update should add only the bytes transferred since the previous update, then add any remaining bytes when the connection closes. The existing metric names and name / type labels would stay the same, so our queries would keep working.

Making this opt-in would let users choose whether they need more frequent updates. With it disabled, frp should keep the current accounting path without the extra periodic work.

Describe alternatives you've considered

A shorter scrape interval still reads stale counters. Host-level network metrics don't provide frp's proxy names, which we need for grouping.

Affected area

  • Performance and Scalability