-
|
在运行bot程序时,高速度的Lagrange 的反向 ws 接收信息下会让nonebot速度越来越慢,几乎是卡一会,然后同时输出几条内容,有非常严重的阻塞,我使用了cProfile来检测性能瓶颈,如下。希望得到帮助和解决方法,tks。 性能报告概览报告 1: 报告 2: 通过 Chatgpt 分析主要发现
以下是我的 pyproject.toml 配置[tool.nonebot]
adapters = [
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
]
plugins = [
"nonebot_plugin_datastore",
"nonebot_plugin_apscheduler",
"nonebot_plugin_htmlrender",
"nonebot_plugin_alconna",
"nonebot_plugin_memes_api",
"nonebot_plugin_tortoise_orm",
"nonebot_plugin_cesaa",
"nonebot_plugin_localstore",
"nonebot_plugin_session",
"nonebot_plugin_saa",
"nonebot_plugin_orm",
]
plugin_dirs = ["src/plugins"]
builtin_plugins = []
[tool.poetry.dependencies]
python = "^3.12"
nonebot-plugin-datastore = "^1.1.2"
nonebot-plugin-tortoise-orm = "^0.1.1"
nonebot-plugin-apscheduler = "^0.5.0"
nonebot-plugin-htmlrender = "^0.3.3"
pil-utils = "^0.1.10"
ujson = "^5.10.0"
httpx = "^0.27.0"
faker = "^26.0.0"
requests = "^2.31.0"
qrcode = "^7.4.2"
aiofile = "^3.8.8"
aiohttp = "^3.9.1"
pyncm = "^1.6.13"
tinydb = "^4.8.0"
jieba = "^0.42.1"
emoji = "^2.9.0"
wordcloud = "^1.9.3"
imageio = "^2.33.1"
pillow = "^10.2.0"
humanize = "^4.9.0"
psutil = "^5.9.7"
aiomysql = "^0.2.0"
sqlalchemy = "^2.0.31"
nonebot-plugin-orm = "^0.7.5"
snakeviz = "^2.2.0"
bilireq = "^0.2.12"
nonebot2 = { extras = ["quart"], version = "^2.3.2" }
starlette = "^0.37.2"
h11 = "^0.14.0"
websockets = "^12.0"
nonebot-adapter-onebot = "^2.4.3"
nonebot-plugin-eventexpiry = "^0.1.1"
jieba-fast = "^0.53"
nonebot-plugin-memes-api = "^0.3.2"
nonebot-plugin-send-anything-anywhere = "^0.6.1"
nonebot-plugin-cesaa = "^0.4.0"
nonebot-plugin-session = "^0.3.1"
nonebot-plugin-session-orm = "^0.2.0" |
Beta Was this translation helpful? Give feedback.
Answered by
yanyongyu
Jul 21, 2024
Replies: 1 comment 1 reply
-
|
请你把所有第三方插件卸载再尝试是否有卡顿。根据你的卡顿现象,我猜卡顿原因多半是插件导致的,有些插件可能存在同步处理阻塞了事件循环。卡一会儿然后一下子吐出很多条,说明nb在接收消息上远没有达到性能瓶颈,卡顿是由于处理部分导致的,请检查插件。 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
wling-art
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请你把所有第三方插件卸载再尝试是否有卡顿。根据你的卡顿现象,我猜卡顿原因多半是插件导致的,有些插件可能存在同步处理阻塞了事件循环。卡一会儿然后一下子吐出很多条,说明nb在接收消息上远没有达到性能瓶颈,卡顿是由于处理部分导致的,请检查插件。