应该是内核导致的 bug:
opened 03:00AM - 10 Apr 24 UTC
more info needed
### Verify steps
- [X] 确保你使用的是**本仓库**最新的的 mihomo 或 mihomo Alpha 版本 Ensure you … are using the latest version of Mihomo or Mihomo Alpha from **this repository**.
- [X] 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can **debug and fix**? Send a pull request! Bug fixes and documentation fixes are welcome.
- [X] 我已经在 [Issue Tracker](……/) 中找过我要提出的问题 I have searched on the [issue tracker](……/) for a related issue.
- [X] 我已经使用 Alpha 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
- [X] 我已经仔细看过 [Documentation](https://wiki.metacubex.one/) 并无法自行解决问题 I have read the [documentation](https://wiki.metacubex.one/) and was unable to solve the issue.
- [X] 这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 This is an issue of the Mihomo core *per se*, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo.
### Mihomo version
1.18.3
### What OS are you seeing the problem on?
Windows
### Mihomo config
```yaml
port: 7890
socks-port: 7891
allow-lan: true
mode: rule
log-level: silent
external-controller: 0.0.0.0:9090
proxy-providers:
...
rule-providers:
...
rules:
...
- GEOIP,CN,🎯 全球直连
- MATCH,🐟 漏网之鱼
redir-port: 7892
tproxy-port: 7895
mixed-port: 7893
secret: "123456"
bind-address: "*"
ipv6: true
dns:
enable: true
ipv6: false
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
use-hosts: true
nameserver: [119.29.29.29, 223.5.5.5, 156.154.70.1, 1.0.0.1]
fallback: ['208.67.222.222:5353', '208.67.220.220:5353', '208.67.222.220:5353', '208.67.220.222:5353', 'https://1.1.1.1/dns-query', 'https://1.1.1.2/dns-query', 'https://1.1.1.3/dns-query', 'https://1.0.0.1/dns-query', 'https://1.0.0.2/dns-query', 'https://1.0.0.3/dns-query', 'https://45.11.45.11/dns-query', 'https://146.112.41.2/dns-query', 'https://162.159.36.1/dns-query', 'https://162.159.46.1/dns-query', 'https://9.9.9.11:5053/dns-query', 'https://101.6.6.6:8443/dns-query', 'https://208.67.222.222/dns-query', 'https://208.67.220.220/dns-query', 'https://185.222.222.222/dns-query', 'https://101.101.101.101/dns-query', 'https://149.112.112.11:5053/dns-query']
fallback-filter: null
geoip: true
ipcidr: [240.0.0.0/4]
profile:
store-selected: true
```
### Mihomo log
_No response_
### Description
ipv6启用√, lan启用√,tun启用√,系统代理启用√。
mihomo:1.18.3 , alpha:72df27b
可能相关的issue:
- https://github.com/MetaCubeX/mihomo/issues/926
启用tun以后, 两分钟就用了11G,所有内存都用完,
使用alpha版本也是一样。
切回clash premium内核则内存稳定60M
![image](https://github.com/MetaCubeX/mihomo/assets/14361541/75138881-bdb9-4131-ab2f-9e680c666480)
那么切换 alpha 版本试试:
然后把内核换为 alpha:
设备是 MacBook air m1,刚刚发现 cpu 占用第一的是 clash-meta,占用百分之六百多,非常 crazy
8 个赞
Windows没这个问题,要不你别用meta,用verge或者别的版本
1 个赞
Wangsi
(Jason Mars)
2024 年5 月 7 日 14:01
5
怎么说呢 相同的机场链接 我放在clash 这类客户端没速度,换nekoray就好了,遇到好几次了我就全面弃用clash系列了,verge meta我都用过 觉得还是nekoray好使,支持的协议也多。
2 个赞
test
(123456)
2024 年5 月 7 日 14:13
7
老版本我也遇到过这个问题,nekoray就正常,clash就直接timeout,不过后来更新了新版本又好了,现在最新的版本,基本上都正常用了
1 个赞
m1 air CPU是 6个大核心+2个省电核心,且不支持超线程。
理论上cpu总共有N个核,top默认进程模式就可以显示到上限 N*100% 。总核数N = CPU物理个数 x 每个CPU的核数 (top 按"1"切换看到的是逻辑cpu个数,不是总核数,注意区别。总逻辑CPU数 = 物理CPU个数 x 每颗物理CPU的核数 x 超线程数)
Linux / Mac OS 经常会显示CPU使用率超过100%。这里显示600%,说明CPU被全部占用了。应该是 clash meta 内核代码有问题,亦或者配置出错。极有可能是路由配置错误导致流量回环了,就是说进入clash的流量在本机形成了一个环状链路一直在内部来回转发,进而导致吃满内存和CPU。
最长前缀匹配机制(Longest Prefix Match Algorithm)是目前行业内几乎所有路由器都缺省采用的一种路由查询机制,当路由器受到一个IP数据包时,它会将数据包的目的IP地址与自己本地路由表中的所有路由表项进行逐位(Bit-By-Bit)比对,直到找到匹配长度度最长的条目,这就是最长前缀匹配机制
手动配置路由表,特别是在需要将流量全部导入某个设备时(比如全局代理),记得额外给出口IP单独添加路由,这时根据最长前缀匹配机制,这条路由将是最高优先级,由它兜底。避免出现流量回环。
–来自 wireguard 的折腾经验
3 个赞