-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot stuck due to high load caused by mongo #488
Comments
This is the only recent change related to DB: Probably under some conditions it gets stuck in a loop which causes DB operation to go crazy. Unfortunately, v1.5 release and all changes after feel like a step backwards because of the amount of major issues, missed bugs and the code not being reviewed properly. |
https://github.com/father-bot/chatgpt_telegram_bot/blob/main/bot/bot.py#L462-L476
These conditions make no sense together for a number of reasons:
I would change this code block to:
I'm not sure if this will resolve the DB overload issue, but it looks much better than the original code. |
Also, why not set "gpt-4o" model by default?
It's pretty stupid that there is no single place to easily change the default model. Is there any reason to keep obsolete models in the list? |
As the title says, since I've been using the bot with the latest changes (master HEAD,
gpt-4o
model), I've noticed that it sometimes becomes unresponsive.Then I went to a server to check what was going on and I couldn't even log into my server because of the crazy-high load caused by the bot (Load Average 25+ on 1 CPU server).
When I finally logged into the server I found that the load was caused by the
mongo
container.I saw it does constant read/write operations at a rate of ~45-50 M/s.
But I couldn't get any relevant logs or other useful information because even simple commands like
top
orps
took a while to process under such load, not to mention anydocker
commands.After killing
mongod --bind_ip_all
process the server went alive again.I'm the only user of my bot and I use it quite rarely so it couldn't be any justifiable load.
I've tried deleting all files and rebuilding the bot image with clean MongoDB but it always happens again after some time.
I've never seen such a problem before v1.5 and
gpt-4o
model, so it must be related to the latest changes.For now, I'm reverting to older releases, even though they don't have
gpt-4o
model.Has anyone else had this problem? It's hard to debug because when it happens the server is unresponsive.
The text was updated successfully, but these errors were encountered: