开发者

Django is terribly slow on Mac OS X Lion

开发者 https://www.devze.com 2023-03-23 11:51 出处:网络
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 m

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 m开发者_JS百科ight 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
0

精彩评论

暂无评论...
验证码 换一张
取 消