-
-
Not
8000
ifications
You must be signed in to change notification settings - Fork 1.4k
Python3 slow query execution #475
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
Comments
https://bugs.python.org/issue18329 is about I measured performance again and again. I believe performance bottleneck is parsing packet, not reading.
Results? |
When loading large number of records, I think bottleneck is here: MySQLdb uses C implementation. 3x slower than MySQLdb is good enough for current PyMySQL. |
All times are measured on old PC with intel Atom and populated mysql database (same can be achived by using raspberryPi).
I have checked you suspicions and you are right:
Do you have any recommendations how can I speed it up other than using MySQLdb? (google didn't help much) |
How about CyMySQL? I'm closing this issue since there is #297 already. |
Ok, thanks. |
I am creating mysql plugin for grabbing "GLOBAL STATUS" data for netdata. It executes one query ("SHOW GLOBAL STATUS") every second which doesn't carry very much data. However I found that your implementation of
cursor.execute(query)
is sluggish. It takes about 2-3x more time than MySQLdb implementation. After some investigation I think that the main reason behind it is usage ofsocket.makefile()
which has some well known performance issues (https://bugs.python.org/issue18329)The text was updated successfully, but these errors were encountered: