I recently did a clean install of OS X Lion. I'm now running Django 1.2.5 on Python 2.6.6 using virtualenv. The MySQL version is 5.5.14 (installed via homebrew). When I run the test suite of one of my applications now, it is just insanely slow. Usually the whole test suite would take about 4-5 minutes. Now after that time it isn't even done with ~30%.
Anybody any ideas on how I could narrow down the bottleneck? Could it be the fresh install of MySQL is just configured bad? How would I benchmark MySQL best and what might be the issue with the (InnoDB) tables? Maybe I'm not the only one having these problems...
OK, so to answer my own question, I found out it was actually just bad default settings for the MySQL installation. I ran over this script called MySQLTuner and it showed me some variables I should change. After following it's recommendations the tests finish in normal times again.
According to this TechCrunch article: Nine Things You Should Do After Installing OS X Lion , Lion is re-indexing your files. Leave it alone for a good few hours.
Following link may help >> http://www.stereoplex.com/blog/speeding-up-django-unit-test-runs-with-mysql
I config /etc/my.cnf with this suggestion, and Django runs fast!
[mysqld]
skip-sync-frm=OFF
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.