mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4049] High CPU/Network Usage in frps #3204
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @martinleopold on GitHub (Mar 8, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4049
Bug Description
I'm trying a simple setup (mainly for https), with
frpsrunning on a cloud server (Ubuntu 20.04.6).I am noticing pretty high CPU and network usage – no client connected at all – simply by running
frps.topshows frps constantly at around 40% CPU.In the hosting control panel it looks even worse. Notice how CPU and network went down near the end of the graph, that's when I killed

frps.frpc Version
0.54.0
frps Version
0.54.0
System Architecture
linux/x86_64
Configurations
frps.toml:
Logs
OS/Machine Info:
Steps to reproduce
frps -c frps.tomlwith the above config fileAffected area
@martinleopold commented on GitHub (Mar 8, 2024):
Short update: I've noticed the issue goes away when changing
vhostHTTPSPortto something different than443, e.g.or
then CPU goes down to 0%.
BTW: In any case - even when CPU usage is high – I can connect with
frpcjust fine and everything works.@fatedier commented on GitHub (Mar 11, 2024):
Exposure of services on the public network being accessed or scanned is very normal, you can troubleshoot traffic on port 443 by capturing packets.
@martinleopold commented on GitHub (Mar 11, 2024):
You are right, didn't think about that.
There are ~5 incoming TCP connections per second on port 443. Each connection attempt has about 8-9 packets exchanged with about 500 bytes of data total.

frpswith loglevel ofdebugortrace, shows tons of messages like this:So I am thinking:
@fatedier commented on GitHub (Mar 11, 2024):
Perhaps there are more professional tools/proxies available that can be used to identify/configure some simple protection rules.
Currently, frp will not make too many changes in this regard; this is more like a capability of a WAF gateway.
@martinleopold commented on GitHub (Mar 15, 2024):
Right, this kind of protection is not the responsibility of frp. This is a small/hobby project so I can't invest in extra services – but I've managed to get the CPU down to idle levels by simply rate limiting incoming connections to the frp server.
Still, would you be willing to accept a PR to include the IP of failed connections in the log output? I feel this could help elsewhere as well, debugging other issues...EDIT: Looking at the code, might be too hard for me actually, to get this right ;)
@fatedier commented on GitHub (Mar 18, 2024):
Yes, we have similar plans in the refactoring of the v2 major version. This is a relatively long-term and complex plan, which is also related to other aspects of refactoring. I will write this part of the code myself.
At this stage, the main focus is on gathering requirements. Your feedback will be helpful for how we will refactor in the future.
@github-actions[bot] commented on GitHub (Apr 9, 2024):
Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.