Sunday, 18 August 2013

Django Slow on Production, fast in test

Django Slow on Production, fast in test

Our web sites hosted with Django are extremely slow on the production
server: Database access seems slow (Mysql), downloading a file is slow (I
tried X-Sendfile, but without impact).
Profiling using something based on this snippet, the heaviest:
ncalls tottime percall cumtime percall filename:lineno(function)
11570 0.577 0.000 0.577 0.000
/var/lib/python-support/python2.6/MySQLdb/times.py:43(DateTime_or_None)
5786 0.500 0.000 0.617 0.000
/usr/local/lib/python2.6/dist-packages/django/db/models/base.py:244(__init__)
5796 0.205 0.000 0.576 0.000
/usr/local/lib/python2.6/dist-packages/django/forms/widgets.py:411(render_option)
8 0.190 0.024 1.014 0.127
/var/lib/python-support/python2.6/MySQLdb/cursors.py:282(_fetch_row)
21.6% 0.577 /var/lib/python-support/python2.6/MySQLdb/times.py
19.4% 0.520 /usr/local/lib/python2.6/dist-packages/django/db/models/base.py
9.5% 0.253 /usr/local/lib/python2.6/dist-packages/django/forms/widgets.py
7.4% 0.199 /var/lib/python-support/python2.6/MySQLdb/cursors.py
33.0% 0.882 /var/lib/python-support/python2.6/MySQLdb
32.6% 0.873 /usr/local/lib/python2.6/dist-packages/django/db
15.4% 0.413 /usr/local/lib/python2.6/dist-packages/django/forms
10.5% 0.280 /usr/local/lib/python2.6/dist-packages/django/utils
This call above was run on a admin page.
What I could do: - update the mysql - update the whole django framework
(still running on 1.1)
But I think, there must be something else why this is so slow. Any ideas?

No comments:

Post a Comment