Ask Your Question

How to improve the speed of askbot?

asked 2011-11-16 03:26:52 -0600

Joseph gravatar image

updated 2011-11-16 03:32:54 -0600

I installed askbot and deployed under nginx, using the instructions in the wiki. (Aside: Is the wiki maintained? I didn't find a link from the main askbot site, only from google?)

I have gzip compression enabled with nginx.

This is a fresh VPS with little running on it and 0 load.

However, load time is quite slow, even after I load the home page once or twice to cache it. (Is there caching?)

According to pingdom, it takes a full 1.84 seconds to load the front page and all assets.

The django request takes 250 ms. This is the connect time, not the DNS lookup or send time.

Also, I see that loading many separate javascript files takes a lot of time, which could be reduced by using a Django app for compressing and minifying the javascript into one asset.

What else could I be doing wrong? Why is a fresh askbot on a fresh VPS taking 1.84 seconds to load?

edit retag flag offensive close merge delete


Joseph, sorry the wiki is not maintained, we use it only for the development docs. I will delete a number of older documents from there. Unfortunately wiki is hard to keep in sync with the software being in the repo.

Evgeny gravatar imageEvgeny ( 2011-11-17 09:52:59 -0600 )edit

3 Answers

Sort by » oldest newest most voted

answered 2011-11-16 19:02:59 -0600

piskvorky gravatar image

Askbot asks for a lot of files (9 javascript files, 3 style sheets, 12 images for the title page...), so configuring caching and expiration headers in your nginx installation is important.

That still doesn't solve the issue with first-hit loads, of course. Like you say, a bundling approach for static files would help a lot here, reducing the number of HTTP requests.

That's the low hanging fruit; the insides of askbot can surely be optimized as well, but I truly believe Evgeny should concentrate on fixing more important stuff first, and consolidating the documentation...

edit flag offensive delete link more


Thanks, we've been focusing on perhaps too many things lately. Will be happy to hear your opinion.

Evgeny gravatar imageEvgeny ( 2011-11-17 07:51:10 -0600 )edit

answered 2012-07-24 04:49:44 -0600

Joseph gravatar image

It turns out that if you through askbot behind a free cloudflare plan, and set up aggressive caching, you can easily get latency down to 200ms.

edit flag offensive delete link more


We've made some improvements since last year, there is room left still.

Evgeny gravatar imageEvgeny ( 2012-07-24 05:42:08 -0600 )edit

Cloudflare free plans are actually pretty cool: They automatically cache static content. They combine and minify js and css. They convert all JS to asynchronous JS. They monitor against spiders and throw up captchas if someone looks like a spammer.

Joseph gravatar imageJoseph ( 2012-07-24 16:23:18 -0600 )edit

I am playing around with cloudflare to see if the aggressive acceleration settings (which are still in beta) break anything. I turned on "Rocket Loaderâ„¢ (Web optimization) (Beta) Automatically asynchronously load all JavaScript resources." which speed up rendering quite noticeably. It would be cool if askbot docs could make recommendations about what cloudflare settings are safe for use, because it is so easy to set up and makes a large difference. So I'm testing it.

Joseph gravatar imageJoseph ( 2012-07-24 16:25:34 -0600 )edit

answered 2011-11-16 06:40:28 -0600

Evgeny gravatar image

It is because on the first hit you compile the application, subsequent requests must be a lot faster. Regarding the media files - if you serve them directly by the webserver they will arrive a lot faster.

However - if the delay is recurring - is must be because of deployment issues like serving media files through python or your vps swapping memory.

edit flag offensive delete link more


Also DEBUG = True can make things a bit slower.

Fitoria gravatar imageFitoria ( 2011-11-16 07:58:28 -0600 )edit

DEBUG = False

Joseph gravatar imageJoseph ( 2011-11-16 14:29:30 -0600 )edit

Also, this is not the first hit. Check out my quesiton again: I reload it once or twice to get these timings. Is there Django caching in askbot?

Joseph gravatar imageJoseph ( 2011-11-16 14:30:51 -0600 )edit

Load is 0. and I have 800 MB of free memory (no swapping).

Joseph gravatar imageJoseph ( 2011-11-16 14:31:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-11-16 03:26:52 -0600

Seen: 3,340 times

Last updated: Jul 24 '12