|
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. |
|
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! |
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?
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.