WebFaction
Community site: login 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 18 Sep '12, 13:33

dontYetKnow
112
accept rate: 0%

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?

(18 Sep '12, 19:52) ryans ♦♦

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.

(19 Sep '12, 09:56) dontYetKnow

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!

permanent link

answered 19 Sep '12, 15:41

seanf
12.2k41836
accept rate: 37%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337
×11

question asked: 18 Sep '12, 13:33

question was seen: 4,025 times

last updated: 19 Sep '12, 15:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM