Book description
As long as there's been a Web, people have been trying to make it faster. The maturation of the Web has meant more users, more data, more features, and consequently longer waits on the Web. Improved performance has become a critical factor in determining the usability of the Web in general and of individual sites in particular.Web Performance Tuning, 2nd Edition is about getting the best possible performance from the Web. This book isn't just about tuning web server software; it's also about streamlining web content, getting optimal performance from a browser, tuning both client and server hardware, and maximizing the capacity of the network itself.Web Performance Tuning hits the ground running, giving concrete advice for quick results -- the "blunt instruments" for improving crippled performance right away. The book then shifts gears to give a conceptual background of the principles of computing performance. The latter half of the book examines each element of a web transaction -- from client to network to server -- to find the weak links in the chain and show how to strengthen them.In this second edition, the book has been significantly expanded to include:
- New chapters on Web site architecture, security, reliability, and their impact on performance
- Detailed discussion of scalability of Java on multi-processor servers
- Perl scripts for writing web performance spiders that handle logins, cookies, SSL, and more
- Detailed instructions on how to use Perl DBI and the open source program gnuplot to generate performance graphs on the fly
- Coverage of rstat, a Unix-based open source utility for gathering performance statistics remotely
Publisher resources
Table of contents
- Web Performance Tuning, 2nd Edition
- Preface
-
I. Preliminary Considerations
-
1. The Quick and the Dead
-
Questions for the Browser Side
- Is Your Modem On?
- Is Your Modem Connected to Your Computer?
- Did the Other End Hang Up on You?
- Are You Sending Data over the Modem?
- Do You Have a Valid IP Address and Gateway Router?
- Is the Browser Hanging?
- Is Your Browser in “Offline” Mode?
- Can You Still Resolve Names?
- Is an Intermediate Router Down or Very Slow?
- Is the Remote Site Overloaded?
- Is the Remote Site Down?
- Is There a Mirror Site?
- Did You Already Get Most of the Page?
- Is Your MTU too Big, or too Small?
- Do You Need to Use a Proxy Server?
- Does Your Proxy Handle https URLs?
- Is There a Faster Proxy Server?
- Are You Being Blocked Deliberately?
- Are You Running too Many Programs?
- Do You Have Enough Memory?
- Is Your CPU Fast Enough?
- Do You Have Enough Bandwidth?
- Are Excessive Images Dragging Down Your Performance?
- Is Browser Startup Time Getting You Down?
- Are You Using a Slow Browser?
- Is Your Cache Big Enough?
- Are You Wasting Time Verifying Cached Pages?
- Is Java Startup Time Annoying You?
- Could You Benefit from Using a Specific ISP?
- Are You Surfing at Slow Times?
- Could Your Organization Benefit by Installing a Proxy Server?
-
Questions for the Server Side
- Is Your Server Sleeping?
- Is Your DNS Server Overloaded?
- Do Your Images All Have Sizes and ALT Tags?
- Do All Your Applets Have ALT Tags?
- Are There Needless or Slow Redirects?
- Is Your Web Server Wasting Time on Reverse DNS Lookups?
- Is Your Web Server Retransmitting too Much?
- Are You too Far Away from Your Users?
- Is Your Server Network Connection Overloaded?
- Is Your Server CPU-Bound?
- Are You Short of Memory?
- Are Your Disks too Busy?
- Could You Benefit from Caching Services?
- Are You Suffering from Performance Bugs That Have Already Been Fixed?
- Is cron Killing Performance at Regular Intervals?
- Is Your Web Site Being Crowded by Other Processes?
- Are You Wasting Time with SSIs?
- Is Your Content Unncessarily Dynamic?
- Is Your Database Connection Pool too Small?
- Is Your Database Connection Pool Leaking?
- Are Your Hubs, Switches, and Routers Overloaded or Misconfigured?
- Do Java Processes Suddenly Stall?
- Are You Using CORBA, EJBs, or RMI?
- Are You Doing Excessive Logging?
- Are You Serving Content Directly from a Revision Control System?
- The Server Is Not at All Busy, but It’s Slow!
- Key Recommendations
-
Questions for the Browser Side
- 2. Web Site Architecture
-
3. Capacity Planning
- Do the Math . . .
- . . . But Trust Your Eyes More than the Math
-
Questions to Ask
- How Many HTTP Operations per Unit Time Do You Expect?
- What Is the Purpose of the Web Site?
- How Tolerant Are Your Users?
- Will You Provide Any Streaming Media?
- Will the Web Server Spawn Additional Processes?
- What Other Processes Need to Run on the Web Server or over the Network?
- What Sort of Scalability Do You Need?
- What Is Your Budget?
- How Available Does Your Site Have to Be?
- Can You Force Suppliers to Compete?
- Hey Kid, Want to Try a Browser?
- Other Questions
- How Much Bandwidth Do You Need?
- How Fast a Server Do You Need?
- How Much Memory Do You Need?
- Key Recommendations
-
4. Performance Monitoring
- Parameters of Performance
- Latency and Throughput
- Utilization
- Efficiency
- Monitoring Web Performance Using Perl
- Automatically Generating Monitoring Scripts Using Sprocket
- Using a Relational Database to Store and Retrieve Your Monitoring Data
- Monitoring Machine Utilization with rstat
- Monitoring Per-Process Statistics
- Generating Graphs from ps Data
- Monitoring Other Things
- Making a System Dashboard Web Page
- Key Recommendations
- 5. Load Testing
- 6. Performance Analysis
-
7. Reliability
-
Typical Failures
- Disk Full
- Process Out of File Descriptors
- C Pointer Error
- Memory Leaks
- Thread Deadlock
- Dead Process Holding Lock
- Server Overloaded
- Load Balancer Fails to Detect Dead Machine
- Subnet Flooded
- Out of ptys
- Database Out of Cursors
- Bad Device Driver
- Hardware Failures
- Power Outage
- Administrator on Wrong Server
- Wildcards Including Wrong File
- Permissions Problems
- Path Problems
- Patch Problems
- Cascade of Overloads
- Monitoring Causing Failures
- Retries Cause Further Failures
- Critical Tables Locked by Accident
- Using a Database Where Files Will Do
- Program Fails to Reconnect to Database After Failure
- Program Fails to Restart After Reboot
- Split-Brain Syndrome
- Firewall “Cleanup” Blocks Essential Service
- Screen Scraping Fails Because of Design Change
- Dependencies
- Smoothing Outages
- Key Recommendations
-
Typical Failures
- 8. Security
- 9. Case Studies
-
10. Principles and Patterns
-
Principles of Performance Tuning
- Sometimes You Lose
- To Measure Something Is to Change It
- Reading Is Fundamental
- There Is No Free Lunch
- Returns Diminish
- Portability Will Reduce Performance
- Increasing Abstraction Will Reduce Performance
- Security Will Reduce Performance
- Memory Is Hierarchical
- Caches Depend on Locality of Reference
- I/O Is Slow
- Information Is Relative
- Hardware Is Cheap, Software Is Expensive
- The Goal of Tuning Is Simultaneous Failure
- Better Is Relative
- Bits Are Cost
- Internet Performance Degrades Nonlinearly
- Tuning at the Highest Level Gives the Biggest Gains
- Whatever Occurs Once Is Likely to Happen Again Soon
- The 80/20 Rule
- It’s Not What You Know, It’s Whom You Know
- Patterns of Performance Improvement
- Key Recommendations
-
Principles of Performance Tuning
-
1. The Quick and the Dead
-
II. Tuning in Depth
- 11. Browsers
- 12. Client Operating System
- 13. Client Hardware
- 14. Lines and Terminators
- 15. Network Protocols
- 16. Server Hardware
-
17. Server Operating System
- Unix and the Origin of the Web
- Unix Flavors
- System Calls Versus Library Calls
- Processes and the Kernel
- The Filesystem
- The Windowing System
- Versions and Patches
- Configurable OS Parameters
- Unix OS Monitoring Tools
- System Call Tracers
- Network Snooping Tools
- How Many Connections Can My Server Handle?
- How Many Processes Can My Server Handle?
- How Quickly Can My Server Fork New Processes?
- Unix Versus NT as the Web Server OS
- The Exokernel
- Key Recommendations
- 18. Server Software
- 19. Content
-
20. Custom Applications
- Programmers
- CGI Programs
- CGI Internals and Performance Problems
- General CGI Tips
- CGI Language-Specific Optimization Tips
- Daemonize It
- CGI Database Access Performance
- Logging
- NSAPI and ISAPI
- DOM
- JSP, ASP, PHP
- Key Recommendations
-
21. Java
- Java Will Never Be Good Enough for GUI Applications
- Java Is Good Enough for the Server Side
- Performance Problems Intrinsic to Java
-
Coding Tips
- Use Good Algorithms
- Keep Short Inheritance Chains
- Use Stack Variables
- Merge Classes
- Use Java Libraries
- Do Not Poll
- Finalize Methods
- Create Fewer Objects
- Beware of Object Leaks
- Consider Not Using Accessor Methods
- Use Compound Operators
- Use Int Increments
- Be Conscious of Access Speed for Different Variables
- Local Variables are Faster than Class Variables
- Class Variables are Faster than Array Accesses
- Use Faster Types as Loop Indexes
- Use Native Methods
- Use Network Timeouts
- Buffer Network and File I/O
- Use Sockets Rather than URLs
- Use UDP
- Use Threads
- Use notify
- Use Synchronization Sparingly
- Keep Synchronized Methods Out of Loops
- Watch Out for the Mother Thread
- Counting Down May Be Faster than Counting Up
- Reduce the Number of Strings
- Use String Buffers or Arrays
- Watch Out for Slow Fonts
- Keep the Paint Method Small
- Double Buffer Where Possible for Smoother Graphics
- Use the Runtime to Do Error Checking for You
- Avoid Time Conversions
- Be Wary of RMI, EJBs, and CORBA
- Compilers
- Profile Your Code
- Decompilers
- OS-Level Profiling Tools
- JITs
- Static Compilers
- Virtual Machines
- Runtime Options
- Java Chips
- Java Benchmarks
- Web Sites with Java Performance Info
- Key Recommendations
- 22. Databases
- A. Web Performance Product Lists and Reviews
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Web Performance Tuning, 2nd Edition
- Author(s):
- Release date: March 2002
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781491950692
You might also like
book
Web Performance Tuning
For as long as there's been a Web, people have been trying to make it faster. …
book
Web performance basics
This excerpt covers all the basic web performance concepts, including metrics, charts, and what they mean.
book
Web Performance in Action
Web Performance in Action is your companion guide to making websites faster. You'll learn techniques that …
book
Modern Web Performance Optimization: Methods, Tools, and Patterns to Speed Up Digital Platforms
Web-based platforms have become vehicles for enterprises to realize their digital strategy and are key to …