Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript
Megnut

Web Topics
All Articles
Browsers
ColdFusion
CSS
Database
Flash
Graphics
HTML/XHTML/DHTML
Scripting Languages
Tools
Weblogs

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab






Top Ten Web Performance Tuning Tips

by Patrick Killelea, author of Web Performance Tuning, 2nd Edition

Editor's note -- In the world of Web publishing, lots of effort goes into building functionality, and to some degree into designing user interface, but performance tuning is often overlooked in the mad rush to get to the next project.

Patrick Killelea believes that performance tuning deserves equal attention alongside other Web publishing tasks, and he's mapped out an excellent approach in his latest O'Reilly book, Web Performance Tuning, 2nd Edition. You can take a look at a sample chapter online that covers Performance Monitoring to get a feel for his approach.

But if you want to get right to the important stuff, take a look at Patrick's top ten performance tips below. These are definitely worth bookmarking.

  1. Check for standards compliance by using Weblint or other HTML checking tools.

  2. Content that conforms to the HTML 4.0 standard will load faster and work in every browser because the browser then knows what to expect. Note that Microsoft-based tools create content that does not even use the standard ASCII character set, but instead uses many proprietary Microsoft characters that will display in Netscape as question marks and can slow down rendering.

    Fast by Default
    Velocity Online Conference Velocity Online Conference
    Dec 8, 2009
    9am-12:40pm PT
    Sharpen your Web Performance and Ops skills right now! Use discount code "velfall09d25." Register Now & Save 25%

  3. Minimize the use of JavaScript and style sheets.

  4. JavaScript is a major source of incompatibility, browser hangs, and pop-up advertising. Style sheets require separate downloads before the page can be displayed. There are some nice features to both JavaScript and style sheets, but at a big cost. Life is better without them.

  5. Turn off reverse DNS lookups in the Web server.

  6. If left on, reverse DNS will log a client's machine name rather than IP address, but at a large performance cost. It is better left off. You can always run log analysis tools which look up the names later.

  7. Try out a free analysis tool.

  8. I've provided a free analysis tool at my Web site that can tell you whether or not your bottleneck is in DNS, or because of connection time or content size, or is on the server side. Work on improving the slowest part first.

  9. Use simple servlets or CGI.

  10. Use simple servlets, CGI, or your Web server's API rather than any distributed object schemes like CORBA or EJB. Distributed object schemes are intended to improve a programmer's code-writing productivity, but they do so at an unacceptable cost in performance for end-users.

  11. Get more memory.

  12. Your Web server, middleware, and database all will probably do better with more memory, if they still use their hard disks frequently. Hard disks are literally about a million times slower than memory, so you should buy more memory until the disks are phased out.

  13. Index your database tables well.

  14. Spectacular improvements are possible if you are inadvertently doing full-table scans on every hit of a particular URL. Indexes allow you to go directly to the data you need.

  15. Make fewer database queries.

  16. If you can cache content in your middleware or servlets, do it. Making connections to a database and using those database connections is typically a bottleneck for performance.

  17. Look for packet loss and retransmission.

  18. There are many network snooping and monitoring tools to help you do this. Intermittent slowness is often due to packets being lost or corrupted. This is because a time-out period needs to pass before the packet is retransmitted.

  19. Set up monitoring and automated graphing of your Web site's performance.

  20. This information is free online in Chapter 4 of the second edition of Web Performance Tuning.

O'Reilly & Associates recently released (March 2002) Web Performance Tuning, 2nd Edition.

Patrick Killelea currently works for Sun Microsystems Professional Services.


Return to the Web Development DevCenter.