5

I would like to prepare my website for a possible influx in traffic. This is my first time using Django as a framework, so I'm unsure of the modifications that should be made to assure that I'm ready and won't go down. What are some of the common things one can do to prepare a Django website for production-level traffic?

I'm also wondering what to expect in terms of traffic numbers. I'm currently hosted at Webfaction with 600GB/month of traffic. Will this quickly run out? Are there statistics on how big 'slashdotted' events are?

2 Answers2

6
  1. Use memcache and caching middleware.
  2. Be sure to offload serving statics.
  3. Use CDN for statics. This doesn't directly affect Django, but will reduce your network traffic.

Anything beyond that — read up what others are using:

vartec
  • 131,205
  • 36
  • 218
  • 244
  • Thanks for those links. I'm currently looking at cloudfare for a CDN. I'll be checking how I can easily implement memcaching with my host, thanks! –  Apr 18 '12 at 14:10
2

Since you are at Webfaction you have an easy answer for handling your statics:

  1. Create a Static-only application. (Not the Static CGI/PHP app)
  2. Add it under you current website.
  3. Put all of your statics under it (or symlink to them, which is what I do).

This will serve all statics through their nginx frontend -- blindingly fast.

Regarding your bandwidth allocation:

You don't say what type of content you are offering. If it is anything even slightly vanilla you are unlikely to approach 600GB/mo. I have one customer who offers adult-oriented videos teaching tantric sex techniques and their video bandwidth (for both free & member-only videos) is about 400-450GB/mo. The HTML portion of the site (with tons of images) runs about 50-60GB/mo.

Peter Rowell
  • 17,605
  • 2
  • 49
  • 65
  • My current set up is the one you mention. I have a seperate app serving my static files. However, this is still contributing to my monthly bandwidth (if only a little). So a CDN might be beneficial for me in that sense. In terms of bandwidth, I have a mostly simple HTML/jQuery and Bootstrap environment. Thanks for your stats, I'm a little more at ease now :) –  Apr 18 '12 at 14:27
  • @Peter Interesting stat. By the way, adult content is prohibited on webfaction (http://www.webfaction.com/aup), isn't it? How could your customer host on webfaction then? Just curious. – RayLuo Jun 26 '13 at 04:42