performance, an overview

22
PERFORMANCE AN OVERVIEW HAVE YOUR CACHE AND EAT IT TOO Created by Tony Aslett / @taslett

Upload: tony-aslett

Post on 07-Dec-2014

165 views

Category:

Internet


3 download

DESCRIPTION

Overview of web site performance.

TRANSCRIPT

Page 1: Performance, an overview

PERFORMANCEAN OVERVIEW

HAVE YOUR CACHE AND EAT IT TOOCreated by Tony Aslett / @taslett

Page 2: Performance, an overview

PERFORMANCETime taken to render in a browser/device.

Neo, follow the white rabbit.

Page 3: Performance, an overview

AFFECTING PERFORMANCENetwork speedServer responseFile sizeNumber of requests

Page 4: Performance, an overview

BROWSER REQUEST1. User: requests a page from the browser2. Network: DNS finds the server and sends request3. Server: responds to the page request, generates page.4. Network: the page is returned.5. Browser: Renders the page, pulls the files (requests) together

Page 5: Performance, an overview

HTTP HEADERSHeaders are sent to and from the server with the request.

Tell points along the path of the request if cache can be used.

Page 6: Performance, an overview

REQUEST HEADERSBrowser, user agentip addressCompression support, gzipCache-controlCookiesReferer

Page 7: Performance, an overview

RESPONSE HEADERSLast-modifiedExpiresCache-controlE-tag

Page 8: Performance, an overview

SAFE TO CACHEAnonymous trafficScripts and stylesheetsImages

Page 9: Performance, an overview

BE WARY OF CACHING:form, post datalogged in usersUser specific content/blocks etc.Dynamic contentHTTPS SSL

Page 10: Performance, an overview

GOOGLE HTTPS EVERYWHEREGoogle is encouraging the use of https by increasing ranking

HTTPS as a ranking signalhttp://youtu.be/cBhZ6S0PFCYpossible rewrite of caching rulesNo support for SSL in varnish

Page 11: Performance, an overview

CACHE LOCATIONSBrowserNetwork: proxyServer: database, memoryCode

Page 12: Performance, an overview

BROWSER CACHEFast, no downloadHeaders cache-control:max-age-?From the second resource loadUse CDN for re-useable external resources

Page 13: Performance, an overview

NETWORK CACHEProxyCDN: Content Delivery Network, cloudflareCloser to the browser/userOpera mobile turboCloud Browsers, Maxthon

Page 14: Performance, an overview

SERVERWatch CPU and Memory usage, new relicOpcode cache, APCMemcacheVarnishnginxSPDY

Page 15: Performance, an overview

APCPHP is converted to opcode (computer readable) on the flyAPC stores files as opcode in memory for reuseSignificant improvementPHP 5.4? has it's own opcode cache

Page 16: Performance, an overview

MEMCACHEKey value stored in memoryWorks well with specific table dataReplaces cache tables

Page 17: Performance, an overview

VARNISHSits before the web serverVery fast 300X

Page 18: Performance, an overview

CODE DRUPALTrack slow queriesAvoid excessive loopsUse drupal_staticCache Views, entities, Blocks blockcache_alterStatic files and content, Boost

Page 19: Performance, an overview

FILESLimit number and sizeCompressAllow cachingDon't delay rendering

Page 20: Performance, an overview

PERFORMANCE TOOLSFind your bottle neck and test your solution.

Page 21: Performance, an overview

BROWSER TOOLSinbuilt developer tools.extensions e.g. pagespeed, yslow

Network requests, file sizes, headers...

Page 22: Performance, an overview

TESTING/REPORTING TOOLSab Apache benchJMeterWebmaster toolsWhat do you use?