Chapter 18.5.3. Scaling at a Lower Cost

Just because you can handle more traffic easily by adding more hardware doesn’t mean that doing so is feasible in practice: All that hardware costs money to buy, and it also costs money to host it. For this reason, you probably want to make sure that you make the most out of your hardware (that is, handle as much traffic as possible with one machine).

To do this, be careful about how you program your application. You should measure how much time requests take to complete and identify the bottlenecks. Also, whenever possible, use caching techniques for your whole pages, or just part of your pages or database queries.

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.