Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hints and tips for faster web apps

Similar presentations


Presentation on theme: "Hints and tips for faster web apps"— Presentation transcript:

1 Hints and tips for faster web apps
Web Performance Hints and tips for faster web apps Andy Heydon VP, Software Development CollegeNET Inc Atlanta - June 8th, 2010

2 Shopzilla Mozilla Netflix
Speeding up their site by 5 seconds increased the conversion rate 7-12%, doubled the number of sessions from search engine marketing, and cut the number of required servers in half. Mozilla  Shaving 2.2 seconds off their landing pages increased download conversions by 15.4%, which they estimate will result in 60 million more Firefox downloads per year. Netflix  Adopting a single optimization, gzip compression, resulted in a 13-25% speedup and cut their outbound network traffic by 50%. Mozilla combined js and inline css

3 Google Webmaster Blob “You may have heard that here at Google we're obsessed with speed, in our products and on the web. As part of that effort, today we're including a new signal in our search ranking algorithms: site speed. Site speed reflects how quickly a website responds to web requests.” Speeding up websites is important — not just to site owners, but to all Internet users. Faster sites create happy users and we've seen in our internal studies that when a site responds slowly, visitors spend less time there. But faster sites don't just improve user experience; recent data shows that improving site speed also reduces operating costs. Like us, our users place a lot of value in speed — that's why we've decided to take site speed into account in our search rankings. We use a variety of sources to determine the speed of a site relative to other sites.

4 Speed is a differentiator
No one will ever complain about your site being too fast Fast = happy customers

5 Anatomy of a web application
Many layers Many discrete requests Stateless

6 Database server Tuning is well known and well documented
Must be sensitive to scale – difficult to judge loads Review indexes New results tables www_schedule new index Obj_search_terms

7 Application server Must use stateless architecture
Optimize state management Cache data In memory for commonly used data Results files or fragments Instrumentation Combined several cookie values into one database record – reduces reads and writes Don’t refresh previously cached data if same user makes another request within a particular threshold – do it on demand Caching is hard to balance – staleness, accuracy, freshness Add instrumentation to record performance times of each step of the process – can’t improve what you can’t measure

8 Application server WRD communicates directly to a layer 4 switch, which then redirects each request in a round robin format to the next available ASV Need shared file server to store cached data that needs to be available to each and every ASV Wrote a “ping” USP so that switch can check which ASVs are up – ping service bypasses standard state restoration and doesn’t force a database connection

9 Web server Use a real web server, not Tomcat to serve static content
Apache has many configuration options: AddOutputFilterByType DEFLATE text/html text/xml text/css application/xml application/javascript <Location “/static”> ExpiresActive On ExpiresDefault "access plus 5 years“ Header set Cache-Control "public, max_age= , pre-check= , post-check= “ </Location> Just because Tomcat can serve static files doesn’t mean it should DEFLATE will gzip content of the specified type – automatically handled by the browser = reduces network traffic Can automatically add far expires cache headers to static content – use a version number in the name YUI Compressor Use tool like Ant to automate the generate of production ready code Minify stylesheets and scripts

10 Browser Greatest amount of variability Can only influence indirectly
A page is composed of the base html, css files, image files and javascript files, and possibly other AJAX loaded resources

11 Browser But… Loading a script can block other downloads
Limited # of connections Important to have something appear on a screen straightaway and show a sense of progress When some browsers start downloading an external script, they wait until the script is done downloading, parsed and executed before starting other downloads. Scripts: Images

12 Browser So, Load scripts “on demand” Use Expires headers
Use version number in each resource Use multiple domains We use a Ant script to massage the scripts into production ready shape – add version numbers to static files, use fixed domain for each image, compress files, strip comments and debugging info Note AJAX resources require a same domain origin, but other resources do not

13 Relative browser performance

14 vs.

15

16 Tools YSlow Page Speed Apache Ant YUI Compressor Gomez

17 Resources http://www.stevesouders.com

18 Slide for big flashy message here

19 Thank You & Questions


Download ppt "Hints and tips for faster web apps"

Similar presentations


Ads by Google