XrayR-project / XrayR

A Xray backend framework that can easily support many panels. 一个基于Xray的后端框架,支持V2ay,Trojan,Shadowsocks协议,极易扩展,支持多面板对接
https://xrayr-project.github.io/XrayR-doc/
Mozilla Public License 2.0
2.11k stars 840 forks source link

全局设备限制触发程序崩溃频繁自动重启,可稳定复现 #131

Closed bbbe-me closed 1 year ago

bbbe-me commented 1 year ago

XrayR v0.8.6 CentOS 7

config.yml

Log:
Level: error
AccessPath: /etc/XrayR/log/access.log

RouteConfigPath: /etc/XrayR/route.json
OutboundConfigPath: /etc/XrayR/outbound.json

ConnetionConfig:
  Handshake: 4
  ConnIdle: 30
  UplinkOnly: 2
  DownlinkOnly: 4
  BufferSize: 64

Nodes:
  -
    PanelType: "V2board"
    ApiConfig:
      ApiHost: "https://test.com"
      ApiKey:  "keykey"
      NodeID: 1
      NodeType: Trojan
      Timeout: 30
      SpeedLimit: 20
      RuleListPath: /etc/XrayR/rulelist

    ControllerConfig:
      ListenIP: 127.0.0.1
      UpdatePeriodic: 60
      EnableProxyProtocol: true

      AutoSpeedLimitConfig:
        Limit: 10
        WarnTimes: 0
        LimitSpeed: 5
        LimitDuration: 60

      GlobalDeviceLimitConfig:
        Limit: 2
        RedisAddr: 1.1.1.1:6379
        RedisPassword:
        RedisDB: 0
        Timeout: 5
        Expiry: 60

      CertConfig:
        CertMode: file
        CertFile: /certificate/cert.pem
        KeyFile:  /certificate/key.pem

测试环境,同城市的不同商家的VPS 比如 Linode 和 Vultr 其中一台做 Redis 服务器为 test-1 ,另一台连接到 test-1 二台机器之间通信延迟不高于 3ms 网络稳定不丢包

Dec 01 08:20:25 hk-test-1 XrayR[9866]: 2022/12/01 08:20:25 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:25 hk-test-1 XrayR[9866]: 2022/12/01 08:20:25 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:25 hk-test-1 XrayR[9866]: 2022/12/01 08:20:25 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:20:25 hk-test-1 XrayR[9866]: 2022/12/01 08:20:25 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:33 hk-test-1 XrayR[9866]: 2022/12/01 08:20:33 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:33 hk-test-1 XrayR[9866]: 2022/12/01 08:20:33 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:33 hk-test-1 XrayR[9866]: 2022/12/01 08:20:33 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:33 hk-test-1 XrayR[9866]: 2022/12/01 08:20:33 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:20:35 hk-test-1 XrayR[9866]: 2022/12/01 08:20:35 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:20:54 hk-test-1 XrayR[9866]: 2022/12/01 08:20:54 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|3
Dec 01 08:20:59 hk-test-1 XrayR[9866]: 2022/12/01 08:20:59 [Trojan: 6] Report 5 online users
Dec 01 08:20:59 hk-test-1 XrayR[9866]: 2022/12/01 08:20:59 [Trojan: 6] 0 user deleted, 0 user added
Dec 01 08:21:12 hk-test-1 XrayR[9866]: 2022/12/01 08:21:12 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:21:13 hk-test-1 XrayR[9866]: 2022/12/01 08:21:13 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|4
Dec 01 08:21:23 hk-test-1 XrayR[9866]: panic: runtime error: invalid memory address or nil pointer dereference
Dec 01 08:21:23 hk-test-1 XrayR[9866]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1e70900]
Dec 01 08:21:23 hk-test-1 XrayR[9866]: goroutine 5309 [running]:
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core/transport/internet/udp.(*Dispatcher).Dispatch(0xc0013a1c20?, {0x33e7b98, 0xc00152a390}, {{0x33e9aa8?, 0xc000aef3b4?}, 0x1bc0?, 0xc0?}, 0xc00152a360)
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core@v1.6.3/transport/internet/udp/dispatcher.go:86 +0x1e0
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core/proxy/trojan.(*Server).handleUDPPayload(0xc0009867b0, {0x33e7b98, 0xc000ff0e40}, 0x0?, 0xc001519d40, {0x33ebb60?, 0xc000d3b110})
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:335 +0x5cb
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core/proxy/trojan.(*Server).Process(0xc0009867b0, {0x33e7b98, 0xc000ff0e40}, 0x33a67b8?, {0x33f68a8?, 0xc000a44ff0}, {0x33ebb60, 0xc000d3b110})
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:235 +0x1b0d
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).callback(0xc000d37180, {0x33f68a8, 0xc000a44ff0})
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:107 +0x6c3
Dec 01 08:21:23 hk-test-1 XrayR[9866]: created by github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start.func1
Dec 01 08:21:23 hk-test-1 XrayR[9866]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:121 +0x98
Dec 01 08:21:23 hk-test-1 systemd[1]: XrayR.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 08:21:23 hk-test-1 systemd[1]: Unit XrayR.service entered failed state.
Dec 01 08:21:23 hk-test-1 systemd[1]: XrayR.service failed.
Dec 01 08:21:33 hk-test-1 systemd[1]: XrayR.service holdoff time over, scheduling restart.
Dec 01 08:21:33 hk-test-1 systemd[1]: Stopped XrayR Service.
Dec 01 08:21:33 hk-test-1 systemd[1]: Started XrayR Service.
Dec 01 08:21:33 hk-test-1 XrayR[10009]: XrayR 0.8.6 (A Xray backend that supports many panels)
Dec 01 08:21:33 hk-test-1 XrayR[10009]: 2022/12/01 08:21:33 Start the panel..
Dec 01 08:21:33 hk-test-1 XrayR[10009]: 2022/12/01 08:21:33 Xray Core Version: 1.6.3
Dec 01 08:21:34 hk-test-1 XrayR[10009]: 2022/12/01 08:21:34 [Trojan: 6] Added 5 new users
Dec 01 08:21:34 hk-test-1 XrayR[10009]: 2022/12/01 08:21:34 [Trojan: 6] Start monitor node status
Dec 01 08:21:34 hk-test-1 XrayR[10009]: 2022/12/01 08:21:34 [Trojan: 6] Start report node status
Dec 01 08:21:48 hk-test-1 XrayR[10009]: 2022/12/01 08:21:48 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:22:27 hk-test-1 XrayR[10009]: 2022/12/01 08:22:27 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|3
Dec 01 08:22:34 hk-test-1 XrayR[10009]: 2022/12/01 08:22:34 [Trojan: 6] Report 5 online users
Dec 01 08:22:34 hk-test-1 XrayR[10009]: 2022/12/01 08:22:34 [Trojan: 6] 0 user deleted, 0 user added
Dec 01 08:22:37 hk-test-1 XrayR[10009]: 2022/12/01 08:22:37 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|3
Dec 01 08:22:45 hk-test-1 XrayR[10009]: 2022/12/01 08:22:45 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:18 hk-test-1 XrayR[10009]: 2022/12/01 08:23:18 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:34 hk-test-1 XrayR[10009]: 2022/12/01 08:23:34 [Trojan: 6] Report 5 online users
Dec 01 08:23:34 hk-test-1 XrayR[10009]: 2022/12/01 08:23:34 [Trojan: 6] 0 user deleted, 0 user added
Dec 01 08:23:41 hk-test-1 XrayR[10009]: 2022/12/01 08:23:41 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:42 hk-test-1 XrayR[10009]: 2022/12/01 08:23:42 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:43 hk-test-1 XrayR[10009]: 2022/12/01 08:23:43 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:44 hk-test-1 XrayR[10009]: 2022/12/01 08:23:44 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:45 hk-test-1 XrayR[10009]: 2022/12/01 08:23:45 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:45 hk-test-1 XrayR[10009]: 2022/12/01 08:23:45 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:23:46 hk-test-1 XrayR[10009]: 2022/12/01 08:23:46 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:25:24 hk-test-1 XrayR[10009]: 2022/12/01 08:25:24 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:25:26 hk-test-1 XrayR[10009]: 2022/12/01 08:25:26 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|5
Dec 01 08:25:27 hk-test-1 XrayR[10009]: 2022/12/01 08:25:27 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|3
Dec 01 08:25:27 hk-test-1 XrayR[10009]: 2022/12/01 08:25:27 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|3
Dec 01 08:25:28 hk-test-1 XrayR[10009]: panic: runtime error: invalid memory address or nil pointer dereference
Dec 01 08:25:28 hk-test-1 XrayR[10009]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1e70900]
Dec 01 08:25:28 hk-test-1 XrayR[10009]: goroutine 8828 [running]:
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core/transport/internet/udp.(*Dispatcher).Dispatch(0xc000f7b560?, {0x33e7b98, 0xc000e0a600}, {{0x33e9aa8?, 0xc0017d30fc?}, 0xb4a0?, 0xc0?}, 0xc000e0a5d0)
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core@v1.6.3/transport/internet/udp/dispatcher.go:86 +0x1e0
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core/proxy/trojan.(*Server).handleUDPPayload(0xc0008b6e70, {0x33e7b98, 0xc000da8db0}, 0x0?, 0xc000da9b90, {0x33ebb60?, 0xc000d9f7a0})
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:335 +0x5cb
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core/proxy/trojan.(*Server).Process(0xc0008b6e70, {0x33e7b98, 0xc000da8db0}, 0x33a67b8?, {0x33f68a8?, 0xc001583738}, {0x33ebb60, 0xc000d9f7a0})
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:235 +0x1b0d
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).callback(0xc000da35e0, {0x33f68a8, 0xc001583738})
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:107 +0x6c3
Dec 01 08:25:28 hk-test-1 XrayR[10009]: created by github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start.func1
Dec 01 08:25:28 hk-test-1 XrayR[10009]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:121 +0x98
Dec 01 08:25:28 hk-test-1 systemd[1]: XrayR.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 08:25:28 hk-test-1 systemd[1]: Unit XrayR.service entered failed state.
Dec 01 08:25:28 hk-test-1 systemd[1]: XrayR.service failed.
Dec 01 08:25:38 hk-test-1 systemd[1]: XrayR.service holdoff time over, scheduling restart.
Dec 01 08:25:38 hk-test-1 systemd[1]: Stopped XrayR Service.
Dec 01 08:25:38 hk-test-1 systemd[1]: Started XrayR Service.
Dec 01 08:25:38 hk-test-1 XrayR[10187]: XrayR 0.8.6 (A Xray backend that supports many panels)
Dec 01 08:25:38 hk-test-1 XrayR[10187]: 2022/12/01 08:25:38 Start the panel..
Dec 01 08:25:38 hk-test-1 XrayR[10187]: 2022/12/01 08:25:38 Xray Core Version: 1.6.3
Dec 01 08:25:38 hk-test-1 XrayR[10187]: 2022/12/01 08:25:38 [Trojan: 6] Added 5 new users
Dec 01 08:25:38 hk-test-1 XrayR[10187]: 2022/12/01 08:25:38 [Trojan: 6] Start monitor node status
Dec 01 08:25:38 hk-test-1 XrayR[10187]: 2022/12/01 08:25:38 [Trojan: 6] Start report node status
Dec 01 08:25:44 hk-test-1 XrayR[10187]: 2022/12/01 08:25:44 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|d3d0d595-0d9d-48ab-91c4-5785a1773995|2
Dec 01 08:25:48 hk-test-1 XrayR[10187]: 2022/12/01 08:25:48 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|2
Dec 01 08:25:56 hk-test-1 XrayR[10187]: panic: runtime error: invalid memory address or nil pointer dereference
Dec 01 08:25:56 hk-test-1 XrayR[10187]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1e70900]
Dec 01 08:25:56 hk-test-1 XrayR[10187]: goroutine 1199 [running]:
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core/transport/internet/udp.(*Dispatcher).Dispatch(0xc00091d7a0?, {0x33e7b98, 0xc0010c8ab0}, {{0x33e9aa8?, 0xc000b6a8d4?}, 0xd740?, 0xc0?}, 0xc0010c8a80)
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core@v1.6.3/transport/internet/udp/dispatcher.go:86 +0x1e0
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core/proxy/trojan.(*Server).handleUDPPayload(0xc0008b8ea0, {0x33e7b98, 0xc00153fda0}, 0x0?, 0xc0010c8930, {0x33ebb60?, 0xc000d7b210})
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:335 +0x5cb
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core/proxy/trojan.(*Server).Process(0xc0008b8ea0, {0x33e7b98, 0xc00153fda0}, 0x33a67b8?, {0x33f68a8?, 0xc0014363e8}, {0x33ebb60, 0xc000d7b210})
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:235 +0x1b0d
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).callback(0xc000d7f2c0, {0x33f68a8, 0xc0014363e8})
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:107 +0x6c3
Dec 01 08:25:56 hk-test-1 XrayR[10187]: created by github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start.func1
Dec 01 08:25:56 hk-test-1 XrayR[10187]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:121 +0x98
Dec 01 08:25:56 hk-test-1 systemd[1]: XrayR.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 08:25:56 hk-test-1 systemd[1]: Unit XrayR.service entered failed state.
Dec 01 08:25:56 hk-test-1 systemd[1]: XrayR.service failed.
Dec 01 08:26:06 hk-test-1 systemd[1]: XrayR.service holdoff time over, scheduling restart.
Dec 01 08:26:06 hk-test-1 systemd[1]: Stopped XrayR Service.
Dec 01 08:26:06 hk-test-1 systemd[1]: Started XrayR Service.
Dec 01 08:26:06 hk-test-1 XrayR[10230]: XrayR 0.8.6 (A Xray backend that supports many panels)
Dec 01 08:26:06 hk-test-1 XrayR[10230]: 2022/12/01 08:26:06 Start the panel..
Dec 01 08:26:06 hk-test-1 XrayR[10230]: 2022/12/01 08:26:06 Xray Core Version: 1.6.3
Dec 01 08:26:07 hk-test-1 XrayR[10230]: 2022/12/01 08:26:07 [Trojan: 6] Added 5 new users
Dec 01 08:26:07 hk-test-1 XrayR[10230]: 2022/12/01 08:26:07 [Trojan: 6] Start monitor node status
Dec 01 08:26:07 hk-test-1 XrayR[10230]: 2022/12/01 08:26:07 [Trojan: 6] Start report node status
Dec 01 08:26:12 hk-test-1 XrayR[10230]: panic: runtime error: invalid memory address or nil pointer dereference
Dec 01 08:26:12 hk-test-1 XrayR[10230]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1e70900]
Dec 01 08:26:12 hk-test-1 XrayR[10230]: goroutine 330 [running]:
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core/transport/internet/udp.(*Dispatcher).Dispatch(0xc000e60ae0?, {0x33e7b98, 0xc000e5cc30}, {{0x33e9aa8?, 0xc000661d64?}, 0xa80?, 0xc0?}, 0xc000e5cc00)
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core@v1.6.3/transport/internet/udp/dispatcher.go:86 +0x1e0
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core/proxy/trojan.(*Server).handleUDPPayload(0xc0008b6ed0, {0x33e7b98, 0xc000e1d800}, 0x0?, 0xc000e5cb40, {0x33ebb60?, 0xc000d7d210})
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:335 +0x5cb
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core/proxy/trojan.(*Server).Process(0xc0008b6ed0, {0x33e7b98, 0xc000e1d800}, 0x33a67b8?, {0x33f68a8?, 0xc000e32178}, {0x33ebb60, 0xc000d7d210})
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core@v1.6.3/proxy/trojan/server.go:235 +0x1b0d
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).callback(0xc000d832c0, {0x33f68a8, 0xc000e32178})
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:107 +0x6c3
Dec 01 08:26:12 hk-test-1 XrayR[10230]: created by github.com/xtls/xray-core/app/proxyman/inbound.(*tcpWorker).Start.func1
Dec 01 08:26:12 hk-test-1 XrayR[10230]: github.com/xtls/xray-core@v1.6.3/app/proxyman/inbound/worker.go:121 +0x98
Dec 01 08:26:12 hk-test-1 systemd[1]: XrayR.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 01 08:26:12 hk-test-1 systemd[1]: Unit XrayR.service entered failed state.
Dec 01 08:26:12 hk-test-1 systemd[1]: XrayR.service failed.
Dec 01 08:26:22 hk-test-1 systemd[1]: XrayR.service holdoff time over, scheduling restart.
Dec 01 08:26:22 hk-test-1 systemd[1]: Stopped XrayR Service.
Dec 01 08:26:22 hk-test-1 systemd[1]: Started XrayR Service.
Dec 01 08:26:22 hk-test-1 XrayR[10240]: XrayR 0.8.6 (A Xray backend that supports many panels)
Dec 01 08:26:22 hk-test-1 XrayR[10240]: 2022/12/01 08:26:22 Start the panel..
Dec 01 08:26:22 hk-test-1 XrayR[10240]: 2022/12/01 08:26:22 Xray Core Version: 1.6.3
Dec 01 08:26:22 hk-test-1 XrayR[10240]: 2022/12/01 08:26:22 [Trojan: 6] Added 5 new users
Dec 01 08:26:22 hk-test-1 XrayR[10240]: 2022/12/01 08:26:22 [Trojan: 6] Start monitor node status
Dec 01 08:26:22 hk-test-1 XrayR[10240]: 2022/12/01 08:26:22 [Trojan: 6] Start report node status
Dec 01 08:26:30 hk-test-1 XrayR[10240]: 2022/12/01 08:26:30 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|1
Dec 01 08:26:35 hk-test-1 XrayR[10240]: 2022/12/01 08:26:35 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|f364d8f1-c979-453c-a448-d6ee483500e8|1
Dec 01 08:27:01 hk-test-1 XrayR[10240]: 2022/12/01 08:27:01 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|1
Dec 01 08:27:01 hk-test-1 XrayR[10240]: 2022/12/01 08:27:01 [Error] rayR/app/mydispatcher: Devices reach the limit: Trojan_127.0.0.1_540|7d371c3c-9efe-46dc-978d-30307d536a83|1

配置文件里的设备限制改成0也就是关闭该功能不会异常重启 GlobalDeviceLimitConfig: Limit: 0

刚开始测试时把 Expiry: 60 改成120秒过期,那重启的更疯狂基本每分钟都重启,无法使用 后来改回默认值60就是现在这情况,还是有重启只是不那么频繁了

在不同地区的机器均有复现,每次重启需要重启三次才能稳定下来,频率大概一小时一到二次,就像日志中那样不到二十秒又会再次重启 高峰期会连续十分钟都这样,这个高峰不是指负载高峰,流量低时候也会这样,看起来是程序内部机制没处理好 使用本地设备限制无此问题,只有全局设备限制才会这样

另外提一点,能否把动态限速的状态也全局共享,反正 Redis 也搞起来了 再开个数据库存限速的状态,比如同区域多后端这样的场景,限速状态只在当时那台后端有效 随着DNS更新或者流量调度同用户的流量可能会落到其他后端机器上,这时又是不限速的状态,如果能共享就完美了

Septrum101 commented 1 year ago

try gloallimit branch

bbbe-me commented 1 year ago

try gloallimit branch

测试 gloallimit 重启倒是没有了,但是 Redis 里面没有任何数据完全是空的,限制也不起作用 尝试重启 XrayR 和 Redis 均无效,直接关闭 Redis XrayR 上也没有任何日志输出 之前 0.8.6 Redis 一旦连不上就会不停的输出日志直到连接上为止

Septrum101 commented 1 year ago

confirm your config is right. you should turn on local limit at the same time. Ref the global limit config example

bbbe-me commented 1 year ago

文档不是建议使用全局设备限制时候关闭本地设备限制吗 0.8.7 必须同时打开本地设备限制才工作??

bbbe-me commented 1 year ago

confirm your config is right. you should turn on local limit at the same time. Ref the global limit config example

截屏2022-12-01 13 41 57
Septrum101 commented 1 year ago

confirm your config is right. you should turn on local limit at the same time. Ref the global limit config example

截屏2022-12-01 13 41 57

We refactor this feat.