Note that there are some explanatory texts on larger screens.

plurals
  1. POPerformance issues with Django
    primarykey
    data
    text
    <p>I'm trying to track down some performance issues I have had with Django. There seems to be a 600-800 ms delay from the time I click refresh to the time the browser gets a response. </p> <p>I set up a simple view and the profile middleware and this is the view and results:</p> <p>the view function:</p> <pre><code>def test(request): return HttpResponse("It works") </code></pre> <p>The profile results( i used <a href="http://www.djangosnippets.org/snippets/186/" rel="nofollow">http://www.djangosnippets.org/snippets/186/</a>):</p> <pre><code>9 function calls in 0.000 CPU seconds Ordered by: internal time, call count ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.000 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/http/__init__.py:487(__init__) 1 0.000 0.000 0.000 0.000 /home/mysite/mysite/mysite/map/views.py:19(test) 1 0.000 0.000 0.000 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/http/__init__.py:532(__setitem__) 3 0.000 0.000 0.000 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/http/__init__.py:517(_convert_to_ascii) 2 0.000 0.000 0.000 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/utils/functional.py:274(__getattr__) 1 0.000 0.000 0.000 0.000 /usr/lib/python2.6/Cookie.py:573(__init__) 0 0.000 0.000 profile:0(profiler) ---- By file ---- tottime 0.0% 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/utils/functional.py 0.0% 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/http/__init__.py 0.0% 0.000 /usr/lib/python2.6/Cookie.py 0.0% 0.000 /home/mysite/mysite/mysite/map/views.py ---- By group --- tottime 0.0% 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/utils 0.0% 0.000 /usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/http 0.0% 0.000 /usr/lib/python2.6 0.0% 0.000 /home/mysite/mysite/mysite/map </code></pre> <p>So with that, the profiler isn't returning any numbers, yet Chrome reports a 647 ms delay from requesting the resource to actually getting any response. My ping time to the server is about 50 ms. Any ideas how I can get better profiling so I can see where in Django is causing this slowdown?</p> <p>My WSGI config. I'm using Cherokee with uwsgi.</p> <pre><code>import os import sys path = '/home/mysite/mysite/mysite/' if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() </code></pre> <p>I see this delay(within 20 ms) on different computers as well as different networks. I'm also seeing it when I just use manage.py runserver.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload