Skip to main content
 
 
Splunk Lantern

Optimizing the performance of single page apps

 

You are an SRE or web developer who has been building a single-page app for your organization. The app is finally up and running, and you want to measure its performance. There are a few different stats you decide to use to track this - your app's Lighthouse Score, Speed Index, its onload time and the total amount of content within the app.

On your first measurement, these scores are not looking too good, so you need to find ways to optimize your app's performance. You notice that your file sizes in particular are quite large, and since your application contains a lot of media content, optimizing this seems like a good first step to take in reducing load times.

This feature is only available in the Rigor platform. Rigor will reach end of life on Feb 28, 2025. For more information, see the Frequently Asked Questions. Synthetics users (regardless of platform) can still create synthetic tests and pull the results into custom dashboard charts to monitor their performance.

How to use Splunk software for this use case

  1. First, you'll need to run some tests to see your baseline performance scores in Splunk Synthetic Monitoring. Open up Splunk Synthetic Monitoring and click on the Real Browser menu option.
  2. Under Basic, select the locations you want to use to test with and the test frequency.
  3. Under Advanced, choose the viewport size and the connection you want to test with.
  4. Under Steps, select what parts of your app you want to be testing. You could track how all elements are loading on the page, or focus on a specific process such as the registration or buying process.

    Untitled.gif

  5. After the test has run you'll be able to see a report of its results. The locations you chose in the settings previously will be visible here, with different location's loading speeds shown with different lines in the chart. Since application speed is relative to user location, it's likely you'll find locations that are furthest from you loading more slowly.

    clipboard_e6cc2ead963c4091d5f7c6c6391c41922.png

  6. By clicking into any of the data points on this initial chart, you can access test results by region.

    clipboard_e7df8dfda9ace6eaee34d22c4a128c9e7.png

  7. Click into a data point then click Show Metrics to access a number of different metrics you can view to understand your performance. Each test collection exposes over 30 different performance metrics so you can select whatever is the most important for your business and report on these metrics over time.

    clipboard_e9ee155e19a4d877d33ca579bf20b9645.png

  8. Hiding this metrics area means you can view a filmstrip to see visually what load performance looks like over time.

    clipboard_eeedc5a02af4ce02200394a4c320d20f2.png

  9. Scrolling down the page, you can see a waterfall chart. This allows you to see what's really going on behind the scenes on user machines, showing how long individual files and images take to load.

    clipboard_e85f45a9d42384609fe8f9cecf0aaf789.png

  10. Select Click here to Analyze with Optimization to identify what types of defects or bugs are presented on the page. This takes you to the Web Optimization tool which programmatically generate a full report of all defects. In the below example, 48 defects have been found. Scrolling down the page shows you all defects sorted by severity, and a simulation of total savings is also produced for each defect.

    clipboard_ea6b940939d0413b47c3ff2b5db8a51c5.png

  11. Clicking into a defect shows you a fuller report of the issue associated with it. As well as showing performance stats, each defect provides you with examples of how it can be fixed.

    clipboard_e69513fda32bf2d8a0d319cf813309651.png

  12. In this example, the image we are looking at could be converted to a different format for faster load times.

    clipboard_eda659da2eb760a9b431daefb3702a540.png

  13. Scrolling down further, you can see a report showing similar files that could be converted, with the total performance savings also listed.

    clipboard_ec8491d7aa816a12d5536afb26e932018.png

  14. After you have made changes to the files and media that have been identified as needing optimization, you can re-run the Real Browser report to see the impact of your performance improvements.

Next steps

The content in this guide comes from a .conf21 session, one of the thousands of Splunk resources available to help users succeed. In addition, these Splunk resources might help you understand and implement this use case:

These additional Splunk resources might help you understand and implement these recommendations:

Splunk OnDemand Services: Use these credit-based services for direct access to Splunk technical consultants with a variety of technical services from a pre-defined catalog. Most customers have OnDemand Services per their license support plan. Engage the ODS team at OnDemand-Inquires@splunk.com if you require assistance.