login community faq

I'm running a Django 1.3 site with Sqlite, and it's very slow on the first database query. I have several other Django sites set up with similar configuration, but using other databases. WebFaction allows persistent Python processes, so I guess it's reloading the Sqlite DB?

Visiting the home page is consistently quick: http://www.simplavortaro.org

Doing a search, which requires a DB connection, takes ~5 seconds on the first search: http://www.simplavortaro.org/?ser%C4%89o=vortaro

Source code is on GitHub.

Thanks.

asked Sep 18 '12 at 13:33

dontYetKnow's gravatar image

dontYetKnow
11

I tried loading a new search URL to attempt to reproduce the problem:

http://www.simplavortaro.org/?ser%C4%89o=wCi3dUjd

And it loaded in less than a second. Is this an intermittent issue for you, or is it consistent and reproducible?

(Sep 18 '12 at 19:52) ryans ♦♦ ryans's gravatar image

It's consistent and reproducible. It's the very first page load accessing the DB. If the site is idle for around an hour or more, the first page load is slow again. Your example URL was slow for me (just now, 15:56 UTC+1) the first time I loaded it.

I'm not sure what the time window is, it may be as low as ten minutes, but it's difficult to measure, especially when other users may be using the site.

(Sep 19 '12 at 09:56) dontYetKnow dontYetKnow's gravatar image

If you're trying to figure out where the slowdown is occurring, then try profiling your code. The profiler results will show you where your code is spending the most time, which should give you a better indication of what the root cause is. The following URLs have a lot of good information on this subject:

Hope that helps!

answered Sep 19 '12 at 15:41

seanf's gravatar image

seanf ♦♦
55991220

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×642
×228
×9

Asked: Sep 18 '12 at 13:33

Seen: 467 times

Last updated: Sep 19 '12 at 15:41

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited