Measuring mobile performance (@LDNWebPerf Version)

4,054 views
4,000 views

Published on

A presentation to the London Web Performance User Group covering the different ways of measuring Mobile web performance and some of the strength & weaknesses of each, depending on your needs.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,054
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
46
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Forget what you thought you knew…
  • Here is one reason why a mobile browser isn’t the same as a desktop browser….(on Android) the “web browser” is a Java App calling a C/C++ app which calls another C app…
  • Different bandwidthDifferent latencyDifferent network layer entirely (Backhaul probably isn’t even IP-based…)
  • And if you throw in CyanogenMod you can get even better performance…
  • And if you throw in CyanogenMod you can get even better performance…
  • What type of network is it connected to?
  • I was on the Thames Clipper on my way back from the O2 after a concert. So I ran some automated testing and this graphs my results… Average32.859Median12.071Std Deviation45.691Min9.275Max156.520
  • Test MarkerTime (Sec)Signal Strength (ASU)19.2753212.681339.68274156.52018512.071969.28513752.86814810.1849923.1658Average32.859Median12.071Std Deviation45.691
  • “Snakes… on a motherf**king plane!” Network latency varies enormously…. What can we see here?The connection is relatively good at sending and receiving data. The green crosses represent packets that were actually lost which only happened for 75 of 1000.There are some crazy-high round trip times. The minimum round trip time was 107ms (which would put my home cable connection to shame) and even the median is pretty awesome at 239ms but the maximum was a whopping 20226 ms - that's more than 20 seconds!
  • 1.JavaScript timing e.g. WebTuna, Boomerang, Episodes2.Browser plug-in e.g. HTTPwatch3.Custom browser variant e.g. A Webkit-build (often used as a monitoring agent)4.Proxy timing e.g. Fiddler proxy5.Web Server Module e.g. APM solutions like AppDynamics, Dynatraceetc6.Network-level e.g. Atomic Labs Pion, Tealeaf, Coradiant
  • 2.Browser plug-in e.g. HTTPwatchBut only some mobile browsers have a plug-in architecture… and exactly what timing info that would provide… I have no idea…
  • 4.Proxy timing e.g. Fiddler proxy or Charles ProxyObserver Affect #1 = http://www.fiddler2.com/fiddler/perf/PerfMeasure.aspObserver Affect #2= http://insidehttp.blogspot.com/2005/06/using-fiddler-for-performance.html
  • 5.Web Server Module e.g. APM solutions like AppDynamics, Dynatraceetc
  • 1.JavaScript timing e.g. WebTuna, Boomerang, EpisodesYou can also use YUI Profiler I believe http://developer.yahoo.com/yui/profilerI have seen JavaScript warnings appear due to “excessive time in the onBeforeUnload event” – so keep in mind that JavaScript is a lot slower in mobile devices and hence the observer effect is larger (and the timing more accurate).
  • Network tap based solutions are great for measuring your own site, not so great for measuring 3rd party sites.PCAPPerf is limited to WiFi… which isn’t anything like the real “mobile” experience. The mobile network stack is NOT the same as the desktop stack, and the client side delay is larger also. *In theory you can use tcpdump on a rooted phone. More on that later…
  • The mobile network stack is NOT the same as the desktop stack, and the client side delay is larger also.
  • Is a tethered, rooted phone over wifi adequate to your needs?
  • Is knowing what’s happening “on the wire” enough, or do you want to understand what’s happening at the browser level?And the “mobile context” …So lets look at a few in detail…
  • Flexible solution (in theory works with every WiFi enabled phone)But WiFi isn’t mobile…And it’s a faff…
  • Essentially the PCAPPerf approach as SaaSBut it does support iPhone and Android.
  • Currently Android only but PoC code for Blackberry and iPhone exists. iPhone client in 90 to 120 days, all being well.
  • Rooted and Tethered, again…
  • Even a PC-based version of Webkit isn’t the same as webkit running on a mobile device. But useful none the less. Lots of other features and unsurprisingly there is a (expensive) Pro version “The MITE Pro annual user license is $5,000 and includes 100 hours of free remote testing. To learn more about single- and multiple-license purchases, please contact us today.”
  • The mobile network stack is NOT the same as the desktop stack, and the client side delay is larger also.
  • Measuring mobile performance (@LDNWebPerf Version)

    1. 1. Stephen Thair, Seriti Consulting, @TheOpsMgr<br />London Web Performance Meetup Group, @LDNWebPerf<br />Measuring mobile performance<br />14/09/2011<br />© Seriti Consulting<br />1<br />
    2. 2. Before we start…<br />3<br />Things to keep in mind<br />14/09/2011<br />© Seriti Consulting<br />2<br />
    3. 3. Desktop<br />≠<br />Mobile<br />14/09/2011<br />© Seriti Consulting<br />3<br />
    4. 4. A Java app calling a java app calling a C++ app using JNI to call a java app….<br />14/09/2011<br />© Seriti Consulting<br />4<br />http://assets.en.oreilly.com/1/event/60/Analyzing%20the%20Performance%20of%20Mobile%20Web_%20Challenges%20and%20Techniques%20Presentation.pdf<br />
    5. 5. Wifi<br />≠<br />Mobile<br />14/09/2011<br />© Seriti Consulting<br />5<br />
    6. 6. WiFivs HSDPA Performance <br />14/09/2011<br />© Seriti Consulting<br />6<br />
    7. 7. Mobile<br />≠<br />Mobile<br />14/09/2011<br />© Seriti Consulting<br />7<br />
    8. 8. Different Phones = Different Performance<br />14/09/2011<br />© Seriti Consulting<br />8<br />http://www.anandtech.com/show/4144/lg-optimus-2x-nvidia-tegra-2-review-the-first-dual-core-smartphone/8<br />
    9. 9. Different operating systems<br />14/09/2011<br />© Seriti Consulting<br />9<br />
    10. 10. Different Browsers…<br />14/09/2011<br />© Seriti Consulting<br />10<br />http://www.webdevelopersnotes.com/articles/mobile-web-browsers-list.php<br />
    11. 11. Different network types…<br />14/09/2011<br />© Seriti Consulting<br />11<br />http://developer.android.com/reference/android/telephony/TelephonyManager.html<br />
    12. 12. Mobile Performance is location-dependent<br />14/09/2011<br />© Seriti Consulting<br />12<br />http://mytests.3pmobile.com/context/?WyIyUFVDZHlWV2ErZHFISmxCSWFXRENnPT0iLCJEYnFYVVp3SEN4MD0iXQ%3D%3D<br />
    13. 13. Page Load times (along the thames)<br />14/09/2011<br />© Seriti Consulting<br />13<br />Off the chart (2m36s)<br />
    14. 14. HSDPA… on a #!%&$@*ing train<br />14/09/2011<br />© Seriti Consulting<br />14<br />Max RTT = 20266ms<br />http://blog.davidsingleton.org/mobiletcp<br />
    15. 15. How important is performance on mobile, anyway?<br />14/09/2011<br />© Seriti Consulting<br />15<br />
    16. 16. You only have 1.5 seconds on mobile!!!<br />14/09/2011<br />© Seriti Consulting<br />16<br />
    17. 17. How many ways are there to measure web performance?<br />And how useful are they on Mobile?<br />14/09/2011<br />© Seriti Consulting<br />17<br />
    18. 18. 6<br />14/09/2011<br />© Seriti Consulting<br />18<br />
    19. 19. 6Browser plug-ins<br />14/09/2011<br />© Seriti Consulting<br />19<br />As used in HTTPWatch, DynatraceAjax Edition etc<br />But only some mobile browsers support plug-ins… Android & iPhone = No, WinMo & Blackberry = Yes. <br />
    20. 20. 5Proxy Timing<br />14/09/2011<br />© Seriti Consulting<br />20<br />E.g. Fiddler Proxy (http://www.fiddler2.com/Fiddler2/version.asp)<br />There is no proxy settings in Android unless you root your phone (http://android-proxy.blogspot.com/)<br />Only useful for WiFi…<br />Beware the “observer effect”<br />
    21. 21. 4Web Server Module<br />14/09/2011<br />© Seriti Consulting<br />21<br />As used by many APM solutions e.g. Dynatrace, New Relic<br />Install mod_ or ISAPI filter <br />Measure the RTT between web server and DB/Application tier<br />Great for measuring your back-end performance<br />Not much good for front end…<br />
    22. 22. 3JavaScript Timing<br />14/09/2011<br />© Seriti Consulting<br />22<br />As used in Boomerang, Episodes, GA, WebTuna etc<br />OK for web pages, better with new WebTiming and NavigationTiming APIs not that mobile browsers support them…<br />Relies on JavaScript and Cookies… which is problematic…<br />
    23. 23. 2 Network level Timing<br />14/09/2011<br />© Seriti Consulting<br />23<br />As used by PCAPPerf and by Atomic Labs Pion, Tealeaf, Coradiant<br />PCAPPERF limited to over WiFi (otherwise you can’t capture the packets)*<br />Pion, Tealeaf etc require network tap…<br />
    24. 24. 1 Custom browser<br />14/09/2011<br />© Seriti Consulting<br />24<br />As used by 3PMobile.com (on the phone) and synthetic agents (by active monitoring providers e.g. Site Confidence)<br />At present this is the only way to get real OTA performance data. <br />
    25. 25. 14/09/2011<br />© Seriti Consulting<br />25<br />So what to use?<br />
    26. 26. 14/09/2011<br />© Seriti Consulting<br />26<br />Depends on your needs<br />
    27. 27. 14/09/2011<br />© Seriti Consulting<br />27<br />Development <br />vs<br />“Real World”<br />
    28. 28. 14/09/2011<br />© Seriti Consulting<br />28<br />Network perspective vsBrowser Perspective? <br />
    29. 29. PCAPPerf Testing <br />14/09/2011<br />© Seriti Consulting<br />29<br />WiFi Connection to PC<br />PC acting as Wifi hotspot and capturing packets with Wireshark<br />Upload pcap file to pcapperf.appspot.com<br />And<br />View the waterfall <br />Upload<br />http://code.google.com/p/pcaphar/wiki/CaptureMobileTraffics<br />
    30. 30. Mobitest – blaze.io/mobile <br />14/09/2011<br />© Seriti Consulting<br />30<br />“PCAPPerfas SaaS” + some on-device event capture + screenshots<br />WiFi only<br />Tethered machines in Ottawa, DC, Amsterdam<br />
    31. 31. Mobitest results screen<br />14/09/2011<br />© Seriti Consulting<br />31<br />Download time<br />Page Size<br />Waterfall<br />Screenshot<br />Link to HAR<br />
    32. 32. Mobitest / PCAPPerf waterfall<br />14/09/2011<br />© Seriti Consulting<br />32<br />
    33. 33. 3PMobile.com “Browser2”<br />14/09/2011<br />© Seriti Consulting<br />33<br />Android Native Browser code instrumented for performance measurement<br />Test Anywhere you have signal…<br />Full Mobile context – device & location & network. WiFi & 3G.<br />Browser-level perspective<br />Screenshots<br />Automated Testing<br />HTML, CSS, Script source code<br />
    34. 34. 3PMobile.com “Browser2” Waterfall<br />14/09/2011<br />© Seriti Consulting<br />34<br />Waterfall of www.ft.com (redirected to http://m.ft.com) <br />
    35. 35. Screenshots<br />14/09/2011<br />© Seriti Consulting<br />35<br />
    36. 36. Device Context<br />14/09/2011<br />© Seriti Consulting<br />36<br />
    37. 37. 14/09/2011<br />© Seriti Consulting<br />37<br />Location Context<br />
    38. 38. 14/09/2011<br />© Seriti Consulting<br />38<br />Network Context<br />
    39. 39. Download the HTML, Script, CSS source<br />14/09/2011<br />© Seriti Consulting<br />39<br />
    40. 40. Sign up for free Beta @ www.3pmobile.com<br />14/09/2011<br />© Seriti Consulting<br />40<br />
    41. 41. 14/09/2011<br />© Seriti Consulting<br />41<br />So what else is there? <br />
    42. 42. TCP Dump on Rooted phone<br />14/09/2011<br />© Seriti Consulting<br />42<br />http://www.vbsteven.be/blog/android-debugging-inspectin-network-traffic-with-tcpdump/<br />
    43. 43. JavaScript Bookmarklets<br />14/09/2011<br />© Seriti Consulting<br />43<br />Steve Souder’s Mobile Performance Bookmarlet<br />http://stevesouders.com/mobileperf/mobileperfbkm.php<br />None of these measure performance per se, but they can give you more information about the page (but beware of a strong “observer effect”) <br />
    44. 44. Keynote MITE (Emulation)<br />14/09/2011<br />© Seriti Consulting<br />44<br />The free Keynote MITE emulator<br />Webkit-based emulation based on device profiles<br />
    45. 45. Debugging tools<br />14/09/2011<br />© Seriti Consulting<br />45<br />Most SDK’s include debugging tools and profilers that can help you understand what’s going on<br />But you are tethered to your PC (normally)<br />
    46. 46. Watchmouse“IAM” library<br />14/09/2011<br />© Seriti Consulting<br />46<br />In-App Monitoring (IAM) is a set of libraries to help instrument your web apps. Currently iPhone only. <br />Replace your app WebView calls with IAMWebView<br />It will gather the performance data and beacon it out for you<br />https://bitbucket.org/watchmouse/iam/<br />
    47. 47. BBC / Epitro Signal Strength Survey<br />14/09/2011<br />© Seriti Consulting<br />47<br />http://www.bbc.co.uk/news/technology-14644507<br />
    48. 48. 14/09/2011<br />© Seriti Consulting<br />48<br />And that’s all I’ve got… <br />
    49. 49. 14/09/2011<br />© Seriti Consulting<br />49<br />Questions?<br />Stephen Thair, Seriti Consulting, @TheOpsMgr<br />Stephen.thair@seriticonsulting.com<br />www.seriticonsulting.com/blog<br />London Web Performance Meetup Group, @LDNWebPerf<br />Monthly Meetups in Central London (near Bank)<br />http://www.meetup.com/London-Web-Performance-Group/<br />

    ×