mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #2895] [Feature Request] 用golang v1.16.7以上版本编译frpc会随机出现短时间cpu利用率100%问题 #2307
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#2307
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 @gmd20 on GitHub (Apr 15, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2895
Describe the feature request
有个服务器上发现frpc会不定时出现cpu100%的问题,持续时间比较短,可能几秒或者几十秒后自动恢复正常。
感觉和 frps的连接的稳定性有关系,可能连接断开重连过就会出问题?
我一开始是用golang v1.18编译的,出现问题后搜索到timer相关的一个bug了(https://github.com/golang/go/issues/51654 ).
后面把golang降级回v1.16.6重新编译frpc,同样的运行环境就没有再出现问题了。
这个bug官方还没有修复,不知道能否在frpc代码这边做一下规避了,不然是支持不了golang v1.17和v1.18
下面这个是出现问题时的top和perf命令的输出:
Describe alternatives you've considered
No response
Affected area
@fatedier commented on GitHub (Apr 17, 2022):
我这边缺乏复现的环境,等官方修复吧,到时候也麻烦帮忙测试下。
@gmd20 commented on GitHub (Apr 18, 2022):
好,看他们帖子里说的可能跟在不同的线程上都修改网络连接的deadline timer有关系。反正我有几台服务器在不同省份网络环境不一样,大部分都会遇到这个问题(一天中可能会出现几次cpu告警),有的办公网网络稳定的就不会遇到问题。 出现问题后全部替换到1.16.6编译的版本就没有再遇到问题了。等官方有更新出来了我到时再看看吧。
@fatedier commented on GitHub (Apr 18, 2022):
你可以试着将 GOMAXPROCS 设置为 1,再测试一下看看,因为 frpc 一般来说不需要耗费太多的 cpu,单核一般也就足够了。
@gmd20 commented on GitHub (Apr 19, 2022):
测试了,golang v1.18.1 还是有问题,设置 GOMAXPROCS=1 后避免这个问题了。
@hongweipeng commented on GitHub (Apr 29, 2022):
我这边也出现了,我用的是 release 页面下载编译后的文件的
@hongweipeng commented on GitHub (Apr 29, 2022):
@HuaWang135608 commented on GitHub (Jul 5, 2022):
确实,我昨天也看到有一个服务器CPU占用100%了
@fatedier commented on GitHub (Jul 14, 2022):
c006b7ac27看起来对应的修复已被合入。
待社区上游发布新的 release 后会重新发布一个 frp 的版本。
@befen commented on GitHub (Nov 25, 2022):
@gmd20 @fatedier
怎么设置 GOMAXPROCS 为 1
@fatedier commented on GitHub (Nov 25, 2022):
最新的 release 版本所使用的 Go 版本应该已经修复此问题。
@befen commented on GitHub (Nov 25, 2022):
@fatedier 好的,谢谢!