4

My django webpage gets all db queries with 45,41 ms (according django debug toolbar), but server returns initial html page with 300-350 ms (i turn off django debug toolbar when i check out this number). Where is the bottleneck could be?

I suppose problem could be with django templates. Are they that slow?

P.S. Must notice it's not a real webserver, but development one (just running app with "python manage.py runserver")

0

2 Answers 2

3

Django's runserver is slow and shouldn't be used for benchmarking.

Django runserver Command: Django’s runserver is only a primitive server and shouldn’t be used for production purposes since it isn’t optimized for speed or designed with security in mind. Instead it allows rapid development which includes automatically reloading your models, views, and urls when you make changes.

Get it running mod_wsgi with Nginx or Apache.

Sign up to request clarification or add additional context in comments.

Comments

3

I think this is a reasonable question and deserving of something more than a deflection. I was in a similar situation where I simply just wanted to get a feel for where a performance bottleneck was; slow queries, ORM, templating engine, type mapping?

Turns out mine was simple, DEBUG=True actually is REALLY heavyweight - my pages were taking about 4secs to load and 3.5secs of that was attributed to the work done by this setting.

Worth noting that I was using the development server at the time, seems like this had a very minimal stake in my situation. Not discounting @scoopseven answer though, is quite valid.

1 Comment

There are better tools which can help with this sort of stuff. blog.newrelic.com/2011/11/08/new-relic-supports-python

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.