1 / 24

Network Performance Effects of HTTP/1.1, CSS1, and PNG

Network Performance Effects of HTTP/1.1, CSS1, and PNG. Jim Gettys Digital Equipment Corporation, ISAC Visiting Scientist, World Wide Web Consortium Henrik Frystyk Nielsen, W3C. Network Performance Effects of HTTP/1.1, CSS1, and PNG. Authors Henrik Frystyk Nielsen, W3C/MIT

enajones
Download Presentation

Network Performance Effects of HTTP/1.1, CSS1, and PNG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Performance Effects of HTTP/1.1, CSS1, and PNG Jim Gettys Digital Equipment Corporation, ISAC Visiting Scientist, World Wide Web Consortium Henrik Frystyk Nielsen, W3C

  2. Network Performance Effects of HTTP/1.1,CSS1, and PNG • Authors Henrik Frystyk Nielsen, W3C/MIT Jim Gettys, W3C / Digital Anselm Baird-Smith, W3C (Now at Sun) Eric Prud’hommeaux, W3C/MIT Håkon Lie, W3C/Inria Chris Lilley, W3C/Inria • Online version http://www.w3.org/Talks/970917HTTP/ Network Performance of HTTP/1.1, CSS1, and PNG

  3. Outline of Talk • HTTP/1.0 and resulting problems • Evaluate the gains of using HTTP/1.1 for Web transport • Does HTTP/1.1 fulfill its design goals? • For the network? (network traffic/behavior) • For the end user? (perceived speed) • No investigation of HTTP/1.1 caching • Test Persistent Connections, Pipelining, Buffering • First Time Retrieval (Filling the cache) • Cache Validation (Subsequent retrievals) • Some investigation of message body compression • Using deflate compression as HTTP/1.1 Content-Encoding • Only effect on first time retrieval test • Content changes effects on network traffic:Analysis of Style Sheets, PNG, and MNG Network Performance of HTTP/1.1, CSS1, and PNG

  4. HTTP/1.0 Protocol • In the Beginning: One TCP connection/URL • Open TCP connection • Make single, MIME-like protocol request and response • Close TCP connection • Was tolerable when the Web was small and lacked graphics • But the Web Content Evolved…. • Most documents now have embedded objects, which are separate resources, usually even smaller than the HTML page • Most resources in the Web are small to compensate for delays • Browsers started using 4 TCP connections in parallel • to avoid RTT delays and to fill PPP link • to get size of embedded objects for fast page layout • to avoid delaying page layout when getting large images • First attempts of HTTP/1.0 persistent connections (keep-alive) • Unfortunately was broken through multiple proxies Network Performance of HTTP/1.1, CSS1, and PNG

  5. Consequences of HTTP/1.0 • Clients opens and closes lots of TCP connections • HTTP/1.0 is likely congesting many links since there are so many short lived TCP connections still in slow start • Closing connections causes loss of congestion information • Servers have 1000s of connections in close_wait state • e.g. AltaVista is at > 20 million searches/day, or >230/second averaged over 24 hours • HTTP servers do more context swapping than real “Web work” • But it seems to work??? • Reasonable end user performance for small objects as they are transmitted in the first few packets • But... • Highly antisocial behavior • Bad performance for long lived TCP connections • Doesn’t scale at all Network Performance of HTTP/1.1, CSS1, and PNG

  6. Consequences of HTTP/1.0 (Cont.) • Vanity DNS hostnames result in big HTTP servers using 100’s of IP addresses and consequential routing headaches • Pushed by market needs • Caching model is primitive and under specified • Lack of granularity and control • Hit-counts is essential for Web advertisement • Result is that content providers often defeat caching to maintain control over content distribution Network Performance of HTTP/1.1, CSS1, and PNG

  7. HTTP/1.1 Facilities • TCP Connections persist across requests • Keep-Alive extension to HTTP/1.0 is broken in the face of proxy chains • Can be maintained across dynamically generated content, distributed authoring, error messages etc. • Provisions for Pipelining • Multiple requests can be outstanding on a given connection • Allows buffering of requests and responses to allow larger segments to be transmitted • Reduces number of round trips required, and allows TCP to run flat out • Range Requests (usually implemented in HTTP/1.0) • Can request parts of a resource • Already implemented in most HTTP servers • Ugly solution to metadata retrieval and fairness problems Network Performance of HTTP/1.1, CSS1, and PNG

  8. Client Server Client Server Time Traditional Pipelined Pipelining and Output Buffering • Pipelining allows multiple outstanding requests, reducing round trips • Responses are still serialized - messages are not interleaved • Difference is timing Network Performance of HTTP/1.1, CSS1, and PNG

  9. Pipelining and Output Buffering (Continued) • Buffering packs TCP segments better • Reduces number of packets (and server context switches) required for same “Web work” • Saves packets, CPU time, and ultimately elapsed time • When to Flush? • If the data in the output buffer exceeds 1K (or MSS) • If the data is buffered longer than N ms (30 ms) • If the application explicitly requests it (via API) • Experimenting with Nagle's algorithm • Turned on/off in both client and server • Unnoticed in initial tests, but later tests showed its effect • Output buffering is to HTTP what Nagle is to telnet • Recommend disabling Nagle (Van Jacobson made good arguments that we may instead have seen a bug in Nagle implementation during questions and after the talk; we will investigate further) Network Performance of HTTP/1.1, CSS1, and PNG

  10. Description of Tests • Mix of Microsoft and Netscape pages ("Microscape") • 1 HTML document (~ 40K) , 43 Inlined images ( ~ 130K) • First Time Retrieval Test • Think: “Visit a site for the first time” • 1 GET request on HTML document • GET requests on 42 inlined images • Cache Validation Test • Think: “Revisit a site you have been to before”, or "reload everything" button on a browser • HTTP/1.0 libwww robot • 1 GET request on HTML document • Simulated cache validation with 42 HEAD requests • HTTP/1.1 libwww robot • 43 HTTP/1.1 Conditional GET requests using entity tags Network Performance of HTTP/1.1, CSS1, and PNG

  11. Network Environments Tested • High Bandwidth, Low Latency • LAN 10 Mbit Ethernet (RTT ~ 1ms) • High Bandwidth, High Latency • Public Internet between MIT/LCS and LBL (RTT ~ 75ms) • Low Bandwidth, High Latency • PPP over 28.8 modem using MIT/LCS dialup access (RTT ~ 150ms) • Tested both Jigsaw and Apache HTTP/1.1 servers, with almost identical results Network Performance of HTTP/1.1, CSS1, and PNG

  12. LAN First-time Retrieval against Apache Network Performance of HTTP/1.1, CSS1, and PNG

  13. WAN First-time Retrieval against Apache Network Performance of HTTP/1.1, CSS1, and PNG

  14. PPP First-time Retrieval against Apache Network Performance of HTTP/1.1, CSS1, and PNG

  15. PPP Cache Validation against Apache Network Performance of HTTP/1.1, CSS1, and PNG

  16. Protocol Test Summary • Pipelining is required for good performance • About half of the packets in HTTP/1.0 is TCP overhead • Many of these are TCP SYN, FIN, and empty ACK packets • These packets do not carry any HTTP information • Many of the packets are not “congestion controlled” • Significant gain by using buffering with pipelining • Validation may use as little as 1/10 the packets of HTTP/1.0A more compact protocol could be 5X or more better • Cache load may use less than 1/2 packets of HTTP/1.0 • The mean size of a packet doubled in our tests • The mean number of packets in a TCP session increased between a factor of 2 and 10 • This is less than one might naively expect, and is due to buffering that reduces the number of packets/connection Network Performance of HTTP/1.1, CSS1, and PNG

  17. Protocol Test Summary (Continued) • HTTP/1.1 is up to 2x faster than HTTP/1.0 for retrieval • On both LAN, WAN, and PPP, one connection outperforms multiple connections • This is elapsed time - not perceived time to render • Server performance also increases when pipelining • Also allows for parallel handling of incoming requests, which can further server performance • Client should control when to close the connection • Client has better information than server about user activity • Recovering a pipeline on client side is hard • Client implementation required some care and effort • Must fetch data from kernel quickly to avoid delayed acks • Implementation time was about 2 people for two months • Server implementation was very easy Network Performance of HTTP/1.1, CSS1, and PNG

  18. Deflate Compression Results • Deflate is clearly better than modem compression • Larger compression window increases compression rate • Compression also helps significantly on a LAN • Since more of the first HTML page arrives in the first, compressed packet, client is more likely to be able to ask for more embedded objects sooner, filling its first request buffer sooner, causing it to be flushed to the server sooner. • Avoids a delayed ACK, which may introduce a 200ms delay • Helps time to render first page significantly • Pipelined HTTP/1.1 with HTML compression beats HTTP/1.0 for first time retrieval test by a factor of 2 (in LAN and WAN test) • Explicit flush after first buffer of compressed HTML? • Increases TCP symmetry in slow start phase of connection • We haven’t tried this yet Network Performance of HTTP/1.1, CSS1, and PNG

  19. Having “fixed” HTTP use of TCP, then what? • Fix the content • Style Sheets • Better image representations (PNG, MNG) • Stupidity (e.g. editors that put gratuitous meta and CRLF’s and &NBSP, or other bad markup) • Compress the content, where not already compressed • Particularly important for low bandwidth use of the Web (where image loading is often turned off) • Delta compression • Mogul, Douglis, Feldman, and Krishnamurthy • Marimba et al’s DRP proposal • Specialized compressed dictionaries? • Compress/Fix/Replace HTTP itself • For cache validation, HTTP overhead now dominatesPotentially a factor of 5 or more gain possible... Network Performance of HTTP/1.1, CSS1, and PNG

  20. What are Style Sheets? • Associating style information with HTML. The image can be represented either as a 682 byte GIF image,or as ~150 bytes of CSS1 and HTML markup (B.C.): P.banner { color: white; background: #FC0; font: bold oblique 20px sans-serif; padding: 0.2em 10em 0.2em 1em;}<P CLASS=3Dbanner>solutions</P> • The class “3Dbanner” above can be used on other <P> HTML tag with yet larger savings • Embed into HTML, or share as external resource Network Performance of HTTP/1.1, CSS1, and PNG

  21. Effects of Style Sheets in Web Contents • Biggest gains may be deployment of style sheets • As significant as protocol improvements • The best image is the one you don’t need anymore! • Style sheets gain in two ways • It represents the same information more compact than bitmap images • It reduces the number of protocol requests for inlined objects • 22 out of 40 static GIFs were easy to convert to CSS • Saves a factor of 4.6, before any compression • 3 images can be replaced by a mixture of CSS and images (saving about 50%) • 14 images were actual images • Does better representation mean less content? • The “extra” bandwidth may be used on even more content Network Performance of HTTP/1.1, CSS1, and PNG

  22. Portable Network Graphics (PNG) andMultiple-image Network Graphics (MNG) • PNG is intended to replace static GIFs • MNG is intended to replace animated GIFs • Advantages of PNG and MNG • Patent free, lossless, gamma correction, and renders faster than GIF • PNG Saved 11,200 out of 92,096 bytes on 40 static GIF images in our tests (12%) • The small saving is because our sample images are already highly optimized with few colors and small sizes, which is typical for professional web sites • For big images, PNG has significant size savings over GIF • MNG Saved 8,659 out of 24,988 bytes on 2 animated GIFs in our tests (35%) Network Performance of HTTP/1.1, CSS1, and PNG

  23. Conclusions • In all our testing, pipelined HTTP/1.1 using one connection ALWAYS beat 1.0 using 4-6 connections • HTTP/1.1 greatly reduces TCP overhead • A factor of 2 less TCP packets on first time retrieval • A factor of 5 or more less TCP packets on cache validation • Pipelining required to beat HTTP/1.0's elapsed time • 20% or more was observed on first time retrieval • 40% or more was observed on cache validation • Output buffering greatly reduces number of packets • Payload compression is significant for performance • Style Sheets as significant as HTTP/1.1 improvements • Don’t trust your TCP implementation! • The Solaris 2.5 TCP stack has serious bugs • Sun was very helpful providing patches Network Performance of HTTP/1.1, CSS1, and PNG

  24. More Information • Performance Overview • http://www.w3.org/Protocols/HTTP/Performance/ • The paper, and all of the TCP traces • http://www.w3.org/Protocols/HTTP/Performance/Pipeline.html • HTTP Protocol • http://www.w3.org/Protocols/ • W3C • http://www.w3.org Network Performance of HTTP/1.1, CSS1, and PNG

More Related