Ask Your Question

How to improve the speed of askbot?

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

Joseph's avatar

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

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's avatar Evgeny  ( 2011-11-17 09:52:59 -0500 )edit

3 Answers

Sort by » oldest newest most voted

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

piskvorky's avatar

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's avatar Evgeny  ( 2011-11-17 07:51:10 -0500 )edit

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

Evgeny's avatar

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's avatar Fitoria  ( 2011-11-16 07:58:28 -0500 )edit

DEBUG = False

Joseph's avatar Joseph  ( 2011-11-16 14:29:30 -0500 )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's avatar Joseph  ( 2011-11-16 14:30:51 -0500 )edit

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

Joseph's avatar Joseph  ( 2011-11-16 14:31:14 -0500 )edit

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

Joseph's avatar

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's avatar Evgeny  ( 2012-07-24 05:42:08 -0500 )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's avatar Joseph  ( 2012-07-24 16:23:18 -0500 )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's avatar Joseph  ( 2012-07-24 16:25:34 -0500 )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 -0500

Seen: 3,558 times

Last updated: Jul 24 '12