sub-store-org / Sub-Store

Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket!
https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46
GNU Affero General Public License v3.0
4.99k stars 553 forks source link

配置同步时报Excessive concurrent requests错误 #329

Closed vernesong closed 3 months ago

vernesong commented 3 months ago

场景∶两个机场订阅,同时添加cachekey参数进行缓存,同步配置数量为16个,包括9个surge配置和7个clash配置。 问题∶同步时报错Excessive concurrent requests

目前规避错误的方式∶ 1、只启用其中一个订阅的cachekey参数,此时可以同步成功 2、将同步配置数量减少到10个,此时可以同步成功

需求∶多个订阅同时启用cachekey的情况下,配置超过10个时能够同步成功。

Sent from PPHub

xream commented 3 months ago

跟 cachekey 没有关系. 就是并发请求太多了. Excessive concurrent requests 是谁报的? 看着好像是代理 App 报的?

vernesong commented 3 months ago

18:15:05.914772 [sub-store] ERROR: 订阅的远程订阅 发生错误: Error: 无法下载 URL: Excessive concurrent requests

xream commented 3 months ago

你什么信息都没提供. 我只能盲猜, 你用了一些脚本. 当你同步时, 并发请求数超了. 自己控制下吧. 一般那些脚本都有并发数的参数.

vernesong commented 3 months ago

这个错误是下载提示的错误,不是脚本处理的错误,只启用一个cachekey的情况下能够同步成功,变量已经指出,还需要提供哪些信息?

xream commented 3 months ago
  1. 我猜这是并发请求太多时 App 的报错(不是 Sub-Store 本身报的错)
  2. 提供运行环境 版本等信息
  3. 如果可以, 让我重现一下. 不然完全没法帮你
  4. 如果第一点没错, 那就是并发请求数超了. 需要你自己控制下. 一般那些脚本都有并发数的参数. 如果你不确定有哪些请求, 你可以通过日志/最近请求来查看当你同步的时候有哪些请求.
vernesong commented 3 months ago

运行环境∶ IPhone12PM Surge5 版本TF 5.100.0 后端∶ 默认后端,版本Surge-2.14.326 ''' { "subs": [ { "name": "Dler", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "ENABLED", "vmess aead": "ENABLED", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "游戏|game|Game" ], "keep": false }, "id": "44959975-0d88-4a14-97e9-9c384f78103b" } ], "url": "", "ua": "Clash", "source": "remote", "mergeSources": "", "form": "", "tag": [], "content": "" }, { "name": "Imm", "displayName": "Imm", "mergeSources": "remoteFirst", "icon": "", "process": [ { "type": "Quick Setting Operator", "args": { "useless": "ENABLED", "udp": "DEFAULT", "scert": "ENABLED", "tfo": "DEFAULT", "vmess aead": "ENABLED" } }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.SGP.$", "now": "新加坡-Imm" }, { "expr": "^.TWN.$", "now": "台湾-Imm" }, { "expr": "^.HKG.$", "now": "香港-Imm" }, { "expr": "^.USA.$", "now": "美国-Imm" }, { "expr": "^.JPN.$", "now": "日本-Imm" } ], "id": "39292849.77184462" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "52411409.06740164" } ], "source": "remote", "url": "", "content": "", "ua": "Clash", "display-name": "Imm", "form": "", "tag": [] } ], "collections": [ { "name": "sg_tw", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "((?=.新加坡)|(?=.台湾))((?=.IEPL)|(?=.AC)|(?=.Imm))" ], "keep": true }, "id": "66dcc76d-8f70-476f-9a33-9c4f5f53682b" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.台湾.$", "now": "台湾" }, { "expr": "^.新加坡.$", "now": "新加坡" } ], "id": "8ba085aa-4f06-4a97-8634-fd991e0718ed" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "1df46f4f-151c-4645-bdeb-292ad694bb71" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "e1375eef-d1ef-4626-99d2-e81c9f06ffbe" }, { "type": "Sort Operator", "args": "asc", "id": "27c9a928-16f7-4778-bae8-10fd23d64d67" } ], "subscriptions": [ "Dler", "Imm" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "us", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "((?=.US)|(?=.美国))((?=.AC)|(?=.IEPL)|(?=.Imm))" ], "keep": true }, "id": "278a9240-5be7-41e7-8cc7-aa0256d1dc45" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.美国.$", "now": "美国" } ], "id": "88fccb41-e7f1-4341-a4f2-55dbd0163696" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "feb8cb82-db1e-4a59-847b-72f563a5ad32" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "4b55d819-64f9-4ead-b74e-9ac826b42c23" }, { "type": "Sort Operator", "args": "asc", "id": "636ae7e8-b1b3-49e8-84b0-3d7dedeef0ae" } ], "subscriptions": [ "Dler", "Imm" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "hk", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "DEFAULT" } }, { "type": "Regex Filter", "args": { "regex": [ "(?=.香港)((?=.IEPL)|(?=.AC)|(?=.Imm))" ], "keep": true }, "id": "0ff6cf58-bfa1-4bb0-aa7b-4e9569b271a7" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.香港.$", "now": "香港" } ], "id": "7ee469ca-8e51-48eb-9b6e-7e13acf7799e" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "09ffcca0-64d4-4b1a-ad71-2dc1f4da5261" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "35b3c07c-54b7-4ee1-8c3c-a6d411bf9ceb" }, { "type": "Sort Operator", "args": "asc", "id": "8561d1f1-b97c-41da-a858-62388b24e956" } ], "subscriptions": [ "Dler", "Imm" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "sg", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "(?=.新加坡)((?=.IEPL)|(?=.Imm)|(?=.AC))" ], "keep": true }, "id": "b86df1ab-3719-470e-86bd-e29f68c2525f" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.新加坡.$", "now": "新加坡" } ], "id": "e98c3f96-b6a6-4718-9dfe-7232a6615cf3" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "fb7b95c7-a8b5-4236-a845-6774eaf8ad5a" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "726f85f1-8f14-4fe5-8140-50b0726f9969" }, { "type": "Sort Operator", "args": "asc", "id": "4e353ba1-b628-4162-8ef5-2d01187d3477" } ], "subscriptions": [ "Imm", "Dler" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "hk_tw_sg", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "((?=.香港)|(?=.新加坡)|(?=.台湾))((?=.IEPL)|(?=.AC)|(?=.Imm))" ], "keep": true }, "id": "68617568-382e-429f-b3d5-dceb111666d2" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.香港.$", "now": "香港" }, { "expr": "^.台湾.$", "now": "台湾" }, { "expr": "^.新加坡.$", "now": "新加坡" } ], "id": "9483926c-7810-46cd-9287-c9c041c004f8" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "a7459300-8fc4-4ca0-abb8-17b46725a053" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "759a5057-38c2-43d7-a2bc-ffa0312c5cdf" }, { "type": "Sort Operator", "args": "asc", "id": "837853c0-68cf-4e5d-8caf-23d29b72df4e" } ], "subscriptions": [ "Dler", "Imm" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "tw", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "(?=.台湾)((?=.IEPL)|(?=.AC)|(?=.Imm))" ], "keep": true }, "id": "1d80d408-0fa1-4d64-98c0-55e94054d15d" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.台湾.$", "now": "台湾" } ], "id": "4bd0b473-fb55-46e7-b4ef-329be138c270" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "b2d5cc91-2f41-4178-bc7a-4317c738a464" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "92d0989e-9355-44ee-a5b8-392e7546783e" }, { "type": "Sort Operator", "args": "asc", "id": "e76dd669-3153-412c-a0f9-e448b0ede9d9" } ], "subscriptions": [ "Dler", "Imm" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "jp", "displayName": "", "mergeSources": "", "icon": "", "process": [ { "type": "Quick Setting Operator", "args": { "useless": "ENABLED", "udp": "DEFAULT", "scert": "DEFAULT", "tfo": "DEFAULT", "vmess aead": "DEFAULT" } }, { "type": "Regex Filter", "args": { "keep": true, "regex": [ "(?=.日本)((?=.IEPL)|(?=.AC)|(?=.Imm))" ] }, "id": "57571155.21482692" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.日本.$", "now": "日本" } ], "id": "73620207.04575029" }, { "type": "Script Operator", "args": { "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}", "mode": "script" }, "id": "63862986.7453806" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "96555902.33718602" }, { "type": "Sort Operator", "args": "asc", "id": "96379720.7173756" } ], "subscriptions": [ "Dler", "Imm" ], "display-name": "", "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "hk-dler", "process": [ { "type": "Quick Setting Operator", "args": { "udp": "DEFAULT", "tfo": "DEFAULT", "scert": "DEFAULT", "vmess aead": "DEFAULT", "useless": "ENABLED" } }, { "type": "Regex Filter", "args": { "regex": [ "(?=.香港)((?=.IEPL)|(?=.AC))" ], "keep": true }, "id": "0ff6cf58-bfa1-4bb0-aa7b-4e9569b271a7" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.香港.$", "now": "香港-DLER" } ], "id": "7ee469ca-8e51-48eb-9b6e-7e13acf7799e" }, { "type": "Script Operator", "args": { "mode": "script", "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}" }, "id": "09ffcca0-64d4-4b1a-ad71-2dc1f4da5261" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "35b3c07c-54b7-4ee1-8c3c-a6d411bf9ceb" }, { "type": "Sort Operator", "args": "asc", "id": "8561d1f1-b97c-41da-a858-62388b24e956" } ], "subscriptions": [ "Dler" ], "ignoreFailedRemoteSub": false, "form": "", "tag": [] }, { "name": "hk-Imm", "displayName": "", "mergeSources": "", "icon": "", "process": [ { "type": "Quick Setting Operator", "args": { "useless": "ENABLED", "udp": "DEFAULT", "scert": "DEFAULT", "tfo": "DEFAULT", "vmess aead": "DEFAULT" } }, { "type": "Regex Filter", "args": { "keep": true, "regex": [ "(?=.香港)" ] }, "id": "69391745.12568039" }, { "type": "Regex Rename Operator", "args": [ { "expr": "^.香港.$", "now": "香港-IMM" } ], "id": "44135722.87548821" }, { "type": "Script Operator", "args": { "content": "function operator(proxies) {\n const counter = {};\n return proxies.map(p => {\n if (!counter[p.name]) counter[p.name] = 0;\n p.name = p.name + ' [' + (('000'+ ++counter[p.name]).slice(-2)).toString() + ']';\n return p;\n });\n}", "mode": "script" }, "id": "26095402.623934437" }, { "type": "Flag Operator", "args": { "mode": "add", "tw": "tw" }, "id": "29401731.11380743" }, { "type": "Sort Operator", "args": "asc", "id": "21242273.894601304" } ], "subscriptions": [ "Imm" ], "display-name": "", "ignoreFailedRemoteSub": false, "form": "", "tag": [] } ], "settings": { "theme": { "darkMode": false }, "githubUser": "vernesong", "gistToken": "", "syncTime": 1716016165299, "avatarUrl": "https://avatars.githubusercontent.com/u/42875168?v=4", "artifactStore": "", "artifactStoreStatus": "VALID", "syncPlatform": "", "defaultUserAgent": "", "defaultTimeout": "10000", "cacheThreshold": "" }, "rules": [], "artifacts": [ { "name": "sg", "type": "collection", "source": "sg", "platform": "Surge", "sync": true, "updated": 1717154880325, "url": "" }, { "name": "hk_tw_sg", "type": "collection", "source": "hk_tw_sg", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "tw", "type": "collection", "source": "tw", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "sg_tw", "type": "collection", "source": "sg_tw", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "hk", "type": "collection", "source": "hk", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "us", "type": "collection", "source": "us", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "jp", "displayName": "", "source": "jp", "type": "collection", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "hk_dler", "displayName": "", "source": "hk-dler", "type": "collection", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "hk_imm", "displayName": "", "source": "hk-Imm", "type": "collection", "platform": "Surge", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "sg_clash", "displayName": "", "source": "sg", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "tw_clash", "displayName": "", "source": "tw", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "hk_clash", "displayName": "", "source": "hk", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "us_clash", "displayName": "", "source": "us", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "jp_clash", "displayName": "", "source": "jp", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880326, "url": "" }, { "name": "hk_dler_clash", "displayName": "", "source": "hk-dler", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880327, "url": "" }, { "name": "hk_imm_clash", "displayName": "", "source": "hk-Imm", "type": "collection", "platform": "Clash", "sync": true, "updated": 1717154880327, "url": "" } ], "schemaVersion": "2.0", "files": [], "modules": [] }

vernesong commented 3 months ago

在使用cachekey的情况下才会出现这种报错,我觉得应该是可以规避的,因为如果两个订阅链接都不启用cachekey也可以同步成功

xream commented 3 months ago

我再确认一下. 你传的这个 json 里只是去除了 订阅和 github token 对不? 订阅链接就是最简单的两个url? 类似这样: https://aaaa.com#cacheKey=aaaahttps://bbbbb.com#cacheKey=bbbbb

vernesong commented 3 months ago

是的,只去除了订阅和token

xream commented 3 months ago

无法复现. 可以确认仅会进行 订阅的请求和 github api 请求. 方便的话 你 telegram 上联系我 @xream 直接发我真实的完整配置试试?

xream commented 3 months ago

备忘:

  1. 加乐观缓存之前

同步时 先找出依赖的单条订阅, 下载单条订阅 组合订阅就能用到单条订阅的缓存, 不需要发多次请求

  1. 加乐观缓存之后

同步时 先找出依赖的单条订阅, 下载单条订阅 组合订阅里用到单条订阅的时候, 因为有乐观缓存, 先返回了单条订阅的内容, 总是会异步更新单条订阅

2.14.327

简单修复乐观缓存(当异步更新乐观缓存时, 若存在常规缓存, 将使用常规缓存)