Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Troubleshooting Ecommerce Performance

Troubleshooting Ecommerce Performance

Presented at SuiteWorld 2018 in Las Vegas, Nevada.

Studies show a direct correlation between website speed and conversion rates: faster speeds equals higher revenue and bigger profits. In this session, we'll demonstrate how to detect and correct various performance pitfalls in SuiteCommerce. We'll teach you all about best practices and tools for ensuring that your web store outperforms your competitors by more than 30%.

Diego Cardozo

May 08, 2018
Tweet

More Decks by Diego Cardozo

Other Decks in Technology

Transcript

  1. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    1 Mark Sweeting & Diego Cardozo Troubleshooting Ecommerce Performance April 24, 2018 COBRAND NAME
  2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    2 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    3 THE SCENARIO A customer has contacted us stating that they have a performance problem with their website. They provide no details about the nature of the problem.
  4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    9 IS THE CDN CONFIGURED AND WORKING? Mac/Linux users, use dig command to check: > dig IN A www.example.com Windows users use nslookup: > nslookup -class=IN -querytype=A www.example.com • Note: use full hostname without protocol (http or https)
  5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    10 IS THE CDN CONFIGURED AND WORKING? GOOD: domain resolves to Akamai A-records www.example.com. 300 IN CNAME www.example.com.hosting.netsuite.com. www.example…netsuite.com. 300 IN CNAME website-cdn.na1.netsuite.com. website-cdn.na1.netsuite.com. 54 IN CNAME website-cdn.na1.netsuite.com.mdc.edgesuite.net. website-cdn.na1.netsuite.com.mdc.edgesuite.net. 415 IN CNAME a1280.q.akamai.net. a1280.q.akamai.net. 14 IN A 213.123.255.6 a1280.q.akamai.net. 14 IN A 213.123.255.9
  6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    11 GOOD: domain resolves to Cloudfront A-records www.example.com. 9 IN CNAME www.example.com.hosting.netsuite.com. www.example......netsuite.com. 299 IN CNAME abcdefghijklmn.cloudfront.net. abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.242 abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.3 abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.96 abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.102 abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.166 abcdefghijklmn.cloudfront.net. 59 IN A 52.85.93.184 IS THE CDN CONFIGURED AND WORKING?
  7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    12 IS THE CDN CONFIGURED AND WORKING? BAD: CNAME OK, but CDN tickbox not checked; resolves to Netsuite datacenter. www.example.com. 600 IN CNAME www.example.com.hosting.netsuite.com. www.example...ting.netsuite.com. 300 IN CNAME 9999999-origin.shop.netsuite.com. 9999999-origin.shop.netsuite.com. 300 IN CNAME shop.source.netsuite.com. shop.source.netsuite.com. 66 IN CNAME shopping.netsuite.com. shopping.netsuite.com. 286 IN A 167.216.129.13
  8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    13 IS THE CDN CONFIGURED AND WORKING? BAD: CNAME not created; A record points straight to Netsuite datacenter. www.example.com. 600 IN A 167.216.129.13
  9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    14 IS THE CDN CONFIGURED AND WORKING? Use Akamai Debug Headers Chrome extension.
  10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    17 TTFB: TIME TO FIRST BYTE • Time it takes for first byte of response content to reach the client browser • Part of the following sequence: −DNS LOOKUP −TCP CONNECTION −SSL NEGOTIATION −REQUEST SEND −TIME TO FIRST BYTE −CONTENT DOWNLOAD (the HTML) • Usually the time it takes for dynamic server-side activities to happen
  11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    20 TOOL: PAGE GENERATOR DEBUGGER ?seodebug=T
  12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    21 HOW TO DEBUG THE PAGE GENERATOR 1. Turn on the debugger: − seodebug=T 2. Bust the cache: − preview=<random string> 3. Force Pre-render (for additional useful output) − seoprerender=T Example: http://www.example.com/some-page?seodebug=T&preview=12345 => Then view the page source…
  13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    22 HOW TO DEBUG THE PAGE GENERATOR • Check the main DIV isn’t empty: <div id=“main”></div> • Search for errors in the output • Examine the timings of sub-requests (prerender only) • Check the status codes of sub-requests (prerender only) • Check sub-requests don’t include any unnecessary content (third parties!)
  14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    24 DEBUGGING: SEARCH FOR ERRORS [02:15:04.188] [ 50961 kb ] [ +34 ms ] [ -574 kb ] Envjs.XMLHttpRequest.Jav8 DEBUG: [Fri, 23 Feb 2018 10:15:04 GMT:187] contentEncoding utf-8 [02:15:04.190] [ 51035 kb ] [ +2 ms ] [ +74 kb ] Envjs.Jav8 ERROR: [Fri, 23 Feb 2018 10:15:04 GMT:190] printStackTrace error {anonymous}("java.io.IOException: Server returned HTTP response code: 400 for URL: https://www.example.com/api/items?country=US&currency=USD&custitem_ef_badges=Best Seller&fieldset=details&language=en&limit=12&pricelevel=5"),printStackTrace(#object),{anonymous}("java.i o.IOException: Server returned HTTP response code: 400 for URL: https://www.example.com/api/items?country=US&currency=USD&custitem_ef_badges=Best Seller&fieldset=details&language=en&limit=12&pricelevel=5"),{anonymou [02:15:04.191] [ 51043 kb ] [ +1 ms ] [ +8 kb ] Envjs.XMLHttpRequest.Jav8 DEBUG: [Fri, 23 Feb 2018 10:15:04 GMT:191] Envjs.connection: finished
  15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    25 DEBUGGING: SLOW SUB-REQUESTS [07:23:34.334] [ +0 ms ] Sub request total: 4.453000s [07:23:34.335] [ +1 ms ] Details of 16 sub requests: GET http://www.example.com/cms/2/assets/js/postframe.js [status 200] Requested at 2018-02-19T15:23:29.414Z and responded by 2018-02-19T15:23:29.497Z (which took 83ms) GET http://www.example.com/cms/2/cms.js [status 200] Requested at 2018-02-19T15:23:29.414Z and responded by 2018-02-19T15:23:29.618Z (which took 204ms) GET http://www.example.com/c.1234567/ShopFlow/sc.environment.ssp?v=1&lang=en_US&cur=AUD [status 302] Requested at 2018-02-19T15:23:29.498Z and responded by 2018-02-19T15:23:29.614Z (which took 116ms) GET http://www.example.com/c.1234567/ShopFlow/js/libs/Libraries-0145005a1354.js [status 200] Requested at 2018-02-19T15:23:29.498Z and responded by 2018-02-19T15:23:29.617Z (which took 119ms) GET http://www.example.com/c.1234567/ShopFlow/templates/Templates-01405a477c8c.js [status 200] Requested at 2018-02-19T15:23:29.498Z and responded by 2018-02-19T15:23:29.615Z (which took 117ms) GET http://www.example.com/c.1234567/ShopFlow/js/Application-01450087b360.js [status 200] Requested at 2018-02-19T15:23:29.499Z and responded by 2018-02-19T15:23:29.616Z (which took 117ms) GET http://www.example.com/c.1234567/CustomWS/common-shopping-customizations.js?v=80 [status 200] Requested at 2018-02-19T15:23:29.499Z and responded by 2018-02-19T15:23:29.617Z (which took 118ms) GET http://www.example.com/c.1234567/ShopFlow/languages/en_US.js?n=18 [status 200] Requested at 2018-02-19T15:23:29.500Z and responded by 2018-02-19T15:23:29.796Z (which took 296ms) GET http://www.example.com/c.1234567/ShopFlow/sc.environment.ssp?cur=AUD&lang=en_US&v=1&whence= [status 200] Requested at 2018-02-19T15:23:29.614Z and responded by 2018-02-19T15:23:32.624Z (which took 3010ms) GET http://www.example.com/api/cms/session/domain [status 200] Requested at 2018-02-19T15:23:32.838Z and responded by 2018-02-19T15:23:32.947Z (which took 109ms) GET http://www.example.com/c.1234567/ShopFlow/services/live-order.ss?internalid=cart&t=1519053812858 [status 200] Requested at 2018-02-19T15:23:32.858Z and responded by 2018-02-19T15:23:33.147Z (which took 289ms) GET http://www.example.com/c.1234567/cds/services/page.ss?internalid=25&ttl=500&cache=MEDIUM [status 200] Requested at 2018-02-19T15:23:32.882Z and responded by 2018-02-19T15:23:33.367Z (which took 485ms) GET http://www.example.com/api/cms/versions?site_id=16&c.1234567 [status 200] Requested at 2018-02-19T15:23:32.948Z and responded by 2018-02-19T15:23:33.047Z (which took 99ms) GET http://www.example.com/api/cms/pages/contents?version_id=2815&site_id=16&c.1234567&path=%2F&page_type= [status 200] Requested at 2018-02-19T15:23:33.049Z and responded by 2018-02-19T15:23:33.247Z (which took 198ms) GET http://www.example.com/c.1234567/CustomWS/BannerSlider/shopping/services/getSlides.ss [status 200] Requested at 2018-02-19T15:23:33.394Z and responded by 2018-02-19T15:23:33.650Z (which took 256ms) GET http://www.example.com/api/cms/pages/contents?version_id=2815&site_id=16&c.1234567&path=%2F&page_type=home-page [status 200] Requested at 2018-02-19T15:23:33.399Z and responded by 2018-02-19T15:23:33.549Z (which took 150ms)
  16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    26 DEBUGGING: FAILED SUB-REQUESTS [07:49:18.431] [ +0 ms ] Sub request total: 0.414000s [07:49:18.431] [ +0 ms ] Details of 4 sub requests: GET https://www.example.com/c.1234567/sca-dev-elbrus/shopping.environment.ssp?lang=en_US&cur=null [status 502] Requested at 2018-02-19T15:49:17.415Z and responded by 2018-02-19T15:49:17.502Z (which took 87ms) GET https://www.example.com/c.1234567/sca-dev-elbrus/languages/shopping_en_US.js?t=1516304321167 [status 502] Requested at 2018-02-19T15:49:17.416Z and responded by 2018-02-19T15:49:17.613Z (which took 197ms) GET https://www.example.com/c.1234567/sca-dev-elbrus/javascript/shopping.js?t=1516304321167 [status 502] Requested at 2018-02-19T15:49:17.416Z and responded by 2018-02-19T15:49:17.615Z (which took 199ms) GET https://www.example.com/cms/2/cms.js [status 502] Requested at 2018-02-19T15:49:17.416Z and responded by 2018-02-19T15:49:17.615Z (which took 199ms)
  17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    28 TOOL: WEBPAGE TEST http://www.webpagetest.org/
  18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    33 IMAGE SIZES • Get the image sizes rights • Use the image resizing service
  19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    34 IMAGE SIZES • Get the image sizes rights • Use the image resizing service
  20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    35 TOOL: IMAGEOPTIM https://imageoptim.com/
  21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    39 PAGE RENDERING – THE USUAL SUSPECTS • Slow blocking responses (i.e. blocking parallel downloads) • Fonts – can seriously delay page rendering • Third parties – insert blocking JavaScript and also delay page rendering − WebPage Test can give you an overview of the percentage of requests that correspond to third parties (domain breakdown) − You can test the impact of removing third parties by right clicking their requests on Chrome’s Dev Tools and selecting “Block request domain”
  22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    40 SLOW SUB-REQUESTS • By this stage we’ve ruled out CDN, page generator, and content weight as causing problems, but there are many other possible causes of slow page load. • We may have identified some of these problems when looking at the waterfall in Webpage Test, or when looking at the sub- requests log in the SEO Debug output, for example: −Item API −Environment files −Categories −Third parties
  23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    42 ITEM API • We need to understand how search works in order to understand why it can be slow • A SolR query is ran on the application server, which indicates which items are to be returned • A database query is ran on the database server, which returns data for those items • We can see those timings the timings using the following parameter: &ssdebug=T Browser SolR Database query
  24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    43 ITEM API 1. Open request on chrome dev tools 2. Add &ssdebug=T parameter SQL = 2.5 s
  25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    44 ITEM API Item (24) Item Data Related Items Custom Fields Item Data, Stock Info, Images • itemid • internalid • displayname • ispurchasable • showoutofstockmessage • stockdescription • outofstockmessage • isbackorderable • isinstock Stock Info Images Pricing Info • onlinecustomerprice • onlinecustomerprice_formatted • priceschedule
  26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    45 ITEM API Item (24) Item Data Related Items Custom Fields • ispurchasable • showoutofstockmessage • stockdescription • outofstockmessage • isbackorderable • isinstock Stock Info Images Pricing Info • onlinecustomerprice • onlinecustomerprice_formatted • priceschedule
  27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    47 ENVIRONMENT FILES – USER ENVIRONMENT •shopping.user.environment is blocking but non-cacheable •Only user-specific content should be found here •Troubleshooting − Check for any information that is not user-specific and remove it − Developers sometimes place data here to make sure that it is always fresh − The problem is that it is loaded in all pages
  28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    48 ENVIRONMENT FILES – REGULAR ENVIRONMENT •shopping.environment.ssp is blocking but cacheable •You can bootstrap information here, but only if it is needed on all pages •If the information is not needed on all pages, you can implement a service to retrieve it on demand •shopping.environment.ssp usually includes: − Categories − CMS − Configuration
  29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    50 CATEGORIES •Design your category structure for performance and usability •3 golden rules for blazingly fast categories: −Use commerce categories −Your category tree shouldn’t be deeper than 3 levels −Each product should be assigned to a single category
  30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    53 SCRIPTABLE CART •What is scriptable cart? •Parallelism between the back end and the web store Sales Order form  BOGO
  31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    54 SCRIPTABLE CART •What is scriptable cart? −Executes client scripts for the sales order record on the web store −Per-website setting −Problem: it executes ALL client scripts •If adding items to the cart is slow, this is generally why
  32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    55 SCRIPTABLE CART - TROUBLESHOOTING •Customization  Scripting  Scripted Records
  33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    56 SCRIPTABLE CART - TROUBLESHOOTING •Solution: exclude client scripts from the web store −If you set execution context to “All Roles”  it executes on the web store −If you set it to “All Employees”  it doesn’t
  34. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    58 PLACE ORDER •Issues on order placement times usually come from workflows and User Events •User Event script execution context −Checkbox called “Execute in Commerce Context” within the script’s deployment −When this option is not selected, the script will not trigger for events that take place in SCA, SB or SCIS
  35. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    59 PLACE ORDER – USER EVENT EXECUTION CONTEXT
  36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    60 PLACE ORDER •Setup  Company  Enable Features  Web Presence −Asynchronous AfterSubmit Sales Order Processing
  37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    64 NETSUITE APM •It only records back end activity •These are the same scripts that run on the web store •You need to know which scripts execute on the web −Client scripts: will run for the shopper role −User Events: if “execute in commerce” is enabled
  38. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    66 STEP-BY-STEP RECAP 1. Check the Content Delivery Network (CDN) 2. Check the SEO Page Generator 3. Optimize your content (use WebPage Test and imageoptim) 4. Optimize page rendering (fonts, third parties, blocking requests) 5. Optimize the Item API 6. Check environment files 7. Review your category structure for speed 8. Review scripts that impact cart timings (scriptable cart) 9. Review user events (use APM) SCA SC SB
  39. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    68 PERFORMANCE SERVICES If you still need some help with investigating or remedying performance issues, then we can help. • Performance reports and benchmarking • Monitoring and alerting • Performance audits • Built to Perform (for new projects) [email protected] [email protected]
  40. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    71 Get involved, visit on Level 3 SuiteWorld