modrzew / pokeminer

Pokemon location scraper
MIT License
220 stars 62 forks source link

High CPU usage from web.py - MySQL #251

Open WhenDaBoostHitU opened 7 years ago

WhenDaBoostHitU commented 7 years ago

I just updated the the newest release (v0.5.4) and now I'm getting extremely high CPU usage. On the previous release (v0.5.3) I was not experiencing this issue. It only happens when I run web.py.

When I run the query SHOW PROCESSLIST; I can see that the query SELECT fs.fort_id, fs.id, ... is causing the problem. I have to go in and manually and kill the query process after aborting the web.py script.

Anyone else experiencing this issue? Any quick fix?

EDIT: I also have all the latest versions of the requirements.txt

Aiyubi commented 7 years ago

just get the latest master where it is fixed

gunawanputra commented 7 years ago

What is the version of mysql you use?

WhenDaBoostHitU commented 7 years ago

@Aiyubi I just downloaded the master version, same problem. @gunawanputra I'm currently running MySQL v5.5

gunawanputra commented 7 years ago

MySQL 5.5 should be able to run the query smoothly. I ask about mySQL version because I got the same problem when try to open web.py. My CPU usage even rise to 100%.

Later I found that I'm still using mysql 5.0.51b that come with xampp 1.6.7. When I try to run get_forts query mysql 5.0 need more than a minute to finish. Right now I'm using xampp 5.6 and migrate my pokeminer to mariaDB, and don't get any problem with the new get_forts query.

Maybe there is in your mysql configuration? What storage engine that you use?

check this link https://bobcares.com/blog/fix-mysql-high-cpu-usage/

modrzew commented 7 years ago

Could you try checking the query on MySQL 5.7 if possible? I don't have any issues with it there.