[GH-ISSUE #1822] 流量监控对不上,入站的流量和用户的流量对不上 #1242

Closed
opened 2026-10-31 20:17:29 +07:00 by bsakaguchi · 11 comments
Owner

Originally created by @2382323268 on GitHub (Feb 15, 2024).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1822

Welcome

  • Yes, I'm using the latest major release. Only such installations are supported.
  • Yes, I'm using the supported system. Only such systems are supported.
  • Yes, I have read all WIKI document,nothing can help me in my problem.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, log, etc).

Description of the problem,screencshot would be good

比如看视频或者进行网速测试,入站流量消耗了200多m,用户的流量才消耗70m,差距有个3到5倍
image

Version of 3x-ui

# 
2.1.3

x-ui log reports or xray log

# paste log here
Originally created by @2382323268 on GitHub (Feb 15, 2024). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/1822 ### Welcome - [X] Yes, I'm using the latest major release. Only such installations are supported. - [X] Yes, I'm using the supported system. Only such systems are supported. - [X] Yes, I have read all WIKI document,nothing can help me in my problem. - [X] Yes, I've searched similar issues on GitHub and didn't find any. - [X] Yes, I've included all information below (version, config, log, etc). ### Description of the problem,screencshot would be good 比如看视频或者进行网速测试,入站流量消耗了200多m,用户的流量才消耗70m,差距有个3到5倍 ![image](https://github.com/MHSanaei/3x-ui/assets/60866587/cfa42750-ab94-4201-9346-0d9306756118) ### Version of 3x-ui <details> ```console # 2.1.3 ``` </details> ### x-ui log reports or xray log <details> ```console # paste log here ``` </details>
Author
Owner

@pulsarice commented on GitHub (Feb 17, 2024):

Reset both inbound and user traffic and test again. I don't have this problem in 3x-ui.

<!-- gh-comment-id:1950323868 --> @pulsarice commented on GitHub (Feb 17, 2024): Reset both inbound and user traffic and test again. I don't have this problem in 3x-ui.
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

重置入站流量和用户流量并再次测试。我在 3x-ui 中没有这个问题。
已重现,vless+Reality+xtls-rprx-vision,然后去www.speedtest.net测试网速,会出现流量对不上
image

<!-- gh-comment-id:1950834082 --> @2382323268 commented on GitHub (Feb 18, 2024): > 重置入站流量和用户流量并再次测试。我在 3x-ui 中没有这个问题。 已重现,vless+Reality+xtls-rprx-vision,然后去www.speedtest.net测试网速,会出现流量对不上 ![image](https://github.com/MHSanaei/3x-ui/assets/60866587/1a004dae-311f-4f5d-9713-713ae28702ac)
Author
Owner

@pulsarice commented on GitHub (Feb 18, 2024):

can you post your xray config here? (xray config > advanced > all)

<!-- gh-comment-id:1950841447 --> @pulsarice commented on GitHub (Feb 18, 2024): can you post your xray config here? (xray config > advanced > all)
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

你能在这里发布你的 xray 配置吗? (X 射线配置 > 高级 > 全部)

{
"log": {
"access": "/usr/local/x-ui/bin/access.log",
"error": "/usr/local/x-ui/bin/error.log",
"loglevel": "warning",
"dnsLog": false
},
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "openai_proxy",
"protocol": "socks",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 40000
}
]
}
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"policy": {
"levels": {
"0": {
"statsUserDownlink": true,
"statsUserUplink": true
}
},
"system": {
"statsInboundDownlink": true,
"statsInboundUplink": true,
"statsOutboundDownlink": true,
"statsOutboundUplink": true
}
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"outboundTag": "openai_proxy",
"domain": [
"geosite:openai",
"geosite:instagram"
]
},
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"ip": [
"geoip:private"
],
"outboundTag": "blocked",
"type": "field"
},
{
"outboundTag": "blocked",
"protocol": [
"bittorrent"
],
"type": "field"
}
]
},
"stats": {}
}

<!-- gh-comment-id:1950843342 --> @2382323268 commented on GitHub (Feb 18, 2024): > 你能在这里发布你的 xray 配置吗? (X 射线配置 > 高级 > 全部) { "log": { "access": "/usr/local/x-ui/bin/access.log", "error": "/usr/local/x-ui/bin/error.log", "loglevel": "warning", "dnsLog": false }, "api": { "services": [ "HandlerService", "LoggerService", "StatsService" ], "tag": "api" }, "inbounds": [ { "listen": "127.0.0.1", "port": 62789, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" } ], "outbounds": [ { "tag": "direct", "protocol": "freedom", "settings": {} }, { "tag": "openai_proxy", "protocol": "socks", "settings": { "servers": [ { "address": "127.0.0.1", "port": 40000 } ] } }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ], "policy": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink": true, "statsOutboundDownlink": true, "statsOutboundUplink": true } }, "routing": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "outboundTag": "openai_proxy", "domain": [ "geosite:openai", "geosite:instagram" ] }, { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { "ip": [ "geoip:private" ], "outboundTag": "blocked", "type": "field" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" } ] }, "stats": {} }
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

你能在这里发布你的x射线配置吗?(X射线配置 > 高级 > 全部)

{ “日志”:{ “访问”:“/usr/local/x-ui/bin/access.log”, “错误”:“/usr/local/x-ui/bin/error.log”, “日志级别” ": "警告", "dnsLog": false }, "api": { "服务": [ "HandlerService", "LoggerService", "StatsService" ], "标签": "api" }, "入站": [ { "listen": "127.0.0.1", "端口": 62789, "协议": "dokodemo-door", "设置": { "地址": "127.0.0.1" }, "标签": "api" } ], "出站": [ { "标签": "直接", "协议": "自由", "设置": {} }, { "标签": "openai_proxy", "协议": "袜子", "settings": { "servers": [ { "address": "127.0.0.1", "port": 40000 } ] } }, { "protocol": "blackhole", "settings": {}, "tag" : "已阻止" } ], "政策": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink" : true, "statsOutboundDownlink": true, "statsOutboundUplink": true } }, "routing": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "outboundTag": "openai_proxy ", "domain": [ "geosite:openai", "geosite:instagram" ] }, { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { “ip”:[ “geoip:私人” ], “outboundTag”:“被阻止”, “类型”:"field" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" } ] }, "stats": {} }

我测试vless+ws+tls是正常的,但是vless+Reality不正常

<!-- gh-comment-id:1950845266 --> @2382323268 commented on GitHub (Feb 18, 2024): > > 你能在这里发布你的x射线配置吗?(X射线配置 > 高级 > 全部) > > { “日志”:{ “访问”:“/usr/local/x-ui/bin/access.log”, “错误”:“/usr/local/x-ui/bin/error.log”, “日志级别” ": "警告", "dnsLog": false }, "api": { "服务": [ "HandlerService", "LoggerService", "StatsService" ], "标签": "api" }, "入站": [ { "listen": "127.0.0.1", "端口": 62789, "协议": "dokodemo-door", "设置": { "地址": "127.0.0.1" }, "标签": "api" } ], "出站": [ { "标签": "直接", "协议": "自由", "设置": {} }, { "标签": "openai_proxy", "协议": "袜子", "settings": { "servers": [ { "address": "127.0.0.1", "port": 40000 } ] } }, { "protocol": "blackhole", "settings": {}, "tag" : "已阻止" } ], "政策": { "levels": { "0": { "statsUserDownlink": true, "statsUserUplink": true } }, "system": { "statsInboundDownlink": true, "statsInboundUplink" : true, "statsOutboundDownlink": true, "statsOutboundUplink": true } }, "routing": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "outboundTag": "openai_proxy ", "domain": [ "geosite:openai", "geosite:instagram" ] }, { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { “ip”:[ “geoip:私人” ], “outboundTag”:“被阻止”, “类型”:"field" }, { "outboundTag": "blocked", "protocol": [ "bittorrent" ], "type": "field" } ] }, "stats": {} } 我测试vless+ws+tls是正常的,但是vless+Reality不正常
Author
Owner

@pulsarice commented on GitHub (Feb 18, 2024):

I tested vless+ws+tls and it was normal, but vless+Reality was not normal.

I'm curious, please test Reality without xtls-rprx-vision. (empty flow) see if still has a problem. I remember something like this happened to me before.

<!-- gh-comment-id:1950850121 --> @pulsarice commented on GitHub (Feb 18, 2024): > I tested vless+ws+tls and it was normal, but vless+Reality was not normal. I'm curious, please test Reality without xtls-rprx-vision. (empty flow) see if still has a problem. I remember something like this happened to me before.
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

xtls-rprx-vision

的确是xtls-rprx-vision导致的,我测试不设置xtls-rprx-vision的情况下流量是正常的,请问这个能修复吗,或者说我不设置xtls-rprx-vision会有什么影响

<!-- gh-comment-id:1950858492 --> @2382323268 commented on GitHub (Feb 18, 2024): > xtls-rprx-vision 的确是xtls-rprx-vision导致的,我测试不设置xtls-rprx-vision的情况下流量是正常的,请问这个能修复吗,或者说我不设置xtls-rprx-vision会有什么影响
Author
Owner

@pulsarice commented on GitHub (Feb 18, 2024):

Also move api rules to the top like this and test

    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "type": "field",
        "outboundTag": "openai_proxy",
        "domain": [
          "geosite:openai",
          "geosite:instagram"
        ]
      },
<!-- gh-comment-id:1950859105 --> @pulsarice commented on GitHub (Feb 18, 2024): Also move api rules to the top like this and test ``` "rules": [ { "inboundTag": [ "api" ], "outboundTag": "api", "type": "field" }, { "type": "field", "outboundTag": "openai_proxy", "domain": [ "geosite:openai", "geosite:instagram" ] }, ```
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},

一样的结果,看来得把xtls-rprx-vision设空才行

<!-- gh-comment-id:1950866339 --> @2382323268 commented on GitHub (Feb 18, 2024): > { > "inboundTag": [ > "api" > ], > "outboundTag": "api", > "type": "field" > }, 一样的结果,看来得把xtls-rprx-vision设空才行
Author
Owner

@pulsarice commented on GitHub (Feb 18, 2024):

I had this problem on my domestic vps server, where:
user >---reality---> domestic vps >---reality-xtls--> foreign vps
and domestic vps didn't count user's traffic.
Then I changed it to:
user >---reality---> domestic vps >---vless-tcp--> foreign vps
and it got fixed.

Tomorrow I'll try to test your config on a clean server and reproduce that behaviour.

<!-- gh-comment-id:1950929905 --> @pulsarice commented on GitHub (Feb 18, 2024): I had this problem on my domestic vps server, where: user >---reality---> domestic vps >---reality-xtls--> foreign vps and domestic vps didn't count user's traffic. Then I changed it to: user >---reality---> domestic vps >---vless-tcp--> foreign vps and it got fixed. Tomorrow I'll try to test your config on a clean server and reproduce that behaviour.
Author
Owner

@2382323268 commented on GitHub (Feb 18, 2024):

我在我的国内vps服务器上遇到了这个问题,其中: 用户>---reality--->国内vps>---reality-xtls-->国外vps 和国内vps没有计算用户的流量。 然后我将其更改为: 用户>>现实--->国内vps>>vless-tcp-->国外vps 并修复了。

明天我将尝试在干净的服务器上测试您的配置并重现该行为。

感谢!已经解决,是xray的bug,
把xray的版本降级到1.8.4
使用xtls-rprx-vision统计流量即可正常

<!-- gh-comment-id:1950983844 --> @2382323268 commented on GitHub (Feb 18, 2024): > 我在我的国内vps服务器上遇到了这个问题,其中: 用户>---reality--->国内vps>---reality-xtls-->国外vps 和国内vps没有计算用户的流量。 然后我将其更改为: 用户>>现实--->国内vps>>vless-tcp-->国外vps 并修复了。 > > 明天我将尝试在干净的服务器上测试您的配置并重现该行为。 感谢!已经解决,是xray的bug, 把xray的版本降级到1.8.4 使用xtls-rprx-vision统计流量即可正常
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#1242
No description provided.