sogebot / sogeBot

sogeBot - Free Twitch Bot built on Node.js
https://sogebot.xyz/
GNU General Public License v3.0
287 stars 65 forks source link

CPU usage on 8.0.0 snapshot, mongodb #1152

Closed ghost closed 6 years ago

ghost commented 6 years ago

Expected behavior

Actual behavior

I tryed run 1 bot with different verions. 7.5.1 use 0.20avg CPU 8.0.0 1.5-2.0avg cpu node_modules cleared, different folders, same systems. Poolsize is same (default 5) no more bots runned under test

Steps to reproduce

Additional informations

8.0.0 latest master. at commit https://github.com/sogehige/sogeBot/commit/82480f5b18c5358ec50edf2212e5ba1c71ab275b 7.5.1 release. Both mongodb

ghost commented 6 years ago

I can provide DB dump if you want

sogehige commented 6 years ago

try on mongodb db.currentOp({“secs_running”: {$gte: 3}})

ghost commented 6 years ago

where i need run that? 1) mongo did i need use database or where?

sogehige commented 6 years ago

run it on mongodb, in compass or whatever mongodb gui you are using

ghost commented 6 years ago

i try in in just console, after mongo, and got this root@home:~# mongo MongoDB shell version: 3.2.11 connecting to: test db.currentOp({“secs_running”: {$gte: 3}}) 2018-08-08T04:26:06.425+0300 E QUERY [thread1] SyntaxError: illegal character @(shell):1:14

sogehige commented 6 years ago

db.currentOp({"secs_running": {$gte: 3}})

sogehige commented 6 years ago

If its empty, lower it to 2 or 1

ghost commented 6 years ago

{ "inprog" : [ ], "ok" : 1 }

sogehige commented 6 years ago

Are you running affected bots? Did you try 2, 1?

ghost commented 6 years ago

And affected bots is runned. Yes, same response. i have 4 bots on latest master now.

sogehige commented 6 years ago

Please enable profiling on mongodb db.setProfilingLevel(2), it should create system.profile collection. Let it run and send it to me tomorrow

sogehige commented 6 years ago

You can disable profiling after with db.setProfilingLevel(0)

ghost commented 6 years ago

i did, but not see that collection

db.setProfilingLevel(2) { "was" : 0, "slowms" : 100, "ok" : 1 } use system switched to db system db.getCollectionInfos() [ ] db.getCollectionNames() [ ]

it's ok?

sogehige commented 6 years ago

It should Oo

https://docs.mongodb.com/manual/tutorial/manage-the-database-profiler/

Are you enabling profiler on affected dbs?

ghost commented 6 years ago

oh no, ok i did it. also i can't keep runned all bots, because 8cpu make crash my mongo service how i can fix that? maybe only 1 bot? Can i downgrade others?

sogehige commented 6 years ago

Please check master after PR #1156 is merged