Monitor Production Performance
Learning Objectives
After completing this unit, you’ll be able to:
- Explain the importance of monitoring performance on the production instance.
- List five job runtime monitoring best practices.
- Explain how to approach customer support problem escalation.
- List the details you need to document when facing network performance issues.
- Explain how the cache hit ratio can help you diagnose a performance problem.
Monitor Performance
Merchants showcase and sell products on the production instance. Everything that happens on the POD where it runs can affect the shopper experience. It’s important to monitor production instance performance from day one.
You need to monitor key performance indicators (KPIs), especially when pushing new data or code or running jobs. When performance degrades, likely culprits include the network or caching. Let’s start by looking at KPIs.
What About KPIs?
Salesforce B2C Commerce performance KPIs help you track and evaluate factors that are crucial to the success and efficiency of the platform. The KPIs listed here can help you understand storefront activity and highlight inefficiencies in custom code.
- Storefront sessions (unique visitor versus robot)
- Request rate
- Order creation
- New basket versus session rate
- Basket creation to update ratio
- Third-party service call response
- HTTP response code
- Cache hit rate
- Average response time
New Code and Data Performance
When a merchant pushes a new version of storefront code or data or a B2C Commerce general availability (GA) release, they should monitor production for performance impact. The Pipeline Profiler and the Technical Reports dashboard are great tools for this. You learned about them in the previous unit.
The Pipeline Profiler monitors the performance of critical pipelines and controllers. Here are the gridwide median responses for the three most critical pipelines.
Pipeline |
Milliseconds |
Search-Show |
= 500 |
Product-Show |
= 500 |
Home-Show |
<= 90 |
Merchants should also monitor search indexing, and optimize the search index if possible.
Job Runtimes
Running jobs during off-peak hours should be automatic, but things happen. You might need to update products to address incorrect product details, or pricing data might come in at the last minute for a special sale. Here are some best practices.
- Analyze jobs that run over an hour for possible optimizations.
- Keep a master record of median job runtimes.
- Don’t include static data (resources) in daily scheduled backups.
- Run import/export jobs sparingly. They consume system resources.
- Always favor standard imports over customizations to modify objects.
- Design import/export jobs so that they recover automatically by recognizing which files haven’t been imported yet during subsequent execution.
- Calculate the job load factor: This is the total number of seconds of job execution time on an instance on a day, divided by 86,400 (number of seconds in a day). The baseline for an individual job is 0.02.
Troubleshoot Performance Issues
What do you do and where do you look when performance degrades? Here are some performance troubleshooting tools you can use.
Tool |
Description |
Chrome DevTools |
Comprehensive, browser-based development tools. |
Firefox Development Tools |
Comprehensive, browser-based development tools. |
Microsoft Edge Development tools |
Comprehensive, browser-based development tools. |
Fiddler |
HTTP Debugging Proxy to log HTTP traffic. |
TamperData |
HTTP/HTTPS headers and POST parameters view and modification. |
Commerce Cloud Einstein Recommendation Validator |
Chrome extension that validates and debugs Commerce Cloud Einstein recommendations and sorting rules in a storefront. |
Google Analytics Real-Time Dashboard |
Monitor activity as it happens on your site or app. The reports are updated continuously and each hit is reported seconds after it occurs. |
GTmetrix |
Run your storefront through the GTmetrix speed test tool to view the Web Vitals score from Google Lighthouse. |
Use your experience as a technical architect to promote the tools that you find the most helpful. New tools are released all the time, with updates that help in ways you can’t even imagine.
Get Customer Support
In the midst of troubleshooting, sometimes you need help from customer support. You can help guide the team through the problem escalation process to make it as smooth as possible.
Key merchant contacts typically duplicate, document, and escalate each issue. It’s important that they know how to collect and document key details. The better the details, the faster the problems will be addressed. Take a look at the Salesforce B2C Commerce Customer Support module to learn how to contact Salesforce Customer Support.
Here are problem escalation basics.
Document |
Tips |
|
1 |
What changed |
|
2 |
How to reproduce the problem |
|
Network Performance Issues
Network issues can be tricky because multiple players might be involved. Fortunately, these types of problems have been around for a while and there’s a wealth of information to help. The merchant must document details such as those listed here so they can get help fast.
Problem |
Questions to ask |
Slowness |
|
Another issue |
|
If the issue is only seen from a specific location or the entire internet is slow, then it's likely to be a local network issue.
Use a performance issue checklist like this one.
Task |
|
1 | Perform a traceroute to identify the bottleneck in your network chain. |
2 |
Use the network view in Firebug and Chrome Dev Tools to analyze requests with long response times.
|
3 |
Check for a browser proxy. If the issue is in Mozilla, click Tools > Network > Settings and set it to No Proxy, restart the browser, and try accessing the site again. If it doesn't resolve the issue, then contact your network administrator. |
Caching Issues
Getting the system cache just right takes effort, and caching issues are common. Here are some best practices and tips.
- Avoid manually clearing the cache. Avoid clearing it during high traffic to prevent degraded performance.
- Pay attention to code replication/activations and data replications, which automatically clear cache unless you specify in a job that they should not.
- Be careful with the
iscache
tag. An iscache tag set to daily in a storefront page clears all pages of a specific type at the same time every day. Use a relative iscache tag if you have issues. - Avoid invalidating page cache just to bring a piece of static content online, or invalidating it several times throughout a day just to update a specific product or to make a small number of changes. Try using page cache partitioning to invalidate controllers/pipelines gradually over a fifteen minute period.
Cache Hit Ratio
As you learned in the previous unit, the cache hit ratio measures how many content requests a cache is able to fill successfully, compared with how many requests it receives. Here are some best practices and tips when using this value.
- Aim for a high cache hit ratio, over 70%, and minimum noncached content, ideally 0%.
- Focus on these critical content pages.
- Home page
- Category pages
- Product tiles
- Product detail page
- Review usage of the iscache
VaryBy
attribute, which instructs the web adaptor to use customer groups and active promotions as part of the key used to look up the cache. How it’s used on a page can degrade performance.
URL Diversity
Make sure URLs are unique.
- The web adapter uses URL with URL parameters as a key to look up cache.
- These URLs don’t use the same cache.
Product-HitTile?pid=apple-ipod-shuffle&position=1
Product-HitTile?position=1&pid=apple-ipod-shuffle
Product-HitTile?pid=apple-ipod-shuffle&position=2
- Always use the same URL parameter order.
- Use URL hashes (parameters behind a #) where there are unique values for each individual shopper (for example, email marketing campaigns).
- URL hashes can be handled only on the client side.
- Use Web Adapter Cache Key Ignore Feature Switch.
Specify position
with # instead of &. That means converting &position=1
to #position=1
so that each URL has the same cache hit.
Here’s an example.
Convert |
|
To |
|
Let’s Wrap It Up
In this unit, you explored ways to track and troubleshoot performance on a production instance. Next, take the final quiz and earn an awesome badge!
Resources
- Trailhead: Salesforce B2C Commerce Cache for Performance & Scalability
- Trailhead: Salesforce B2C Commerce Scheduled Jobs
- Trailhead: Salesforce B2C Commerce Customer Support
- Trailhead: Salesforce B2C Commerce Replication
- Trailhead: Salesforce B2C Commerce SEO URLs
- External Link: Chrome DevTools
- External Link: Firefox Development Tools
- External Link: Microsoft Edge Developer tools
- External Link: Telerik Fiddler
- External Link: FireFox Browser Add-Ons: TamperData for FF Quantum
- Salesforce Help: Commerce Cloud Einstein Recommendation Validator
- External Link: Google Analytics Help: About Real-Time
- External Link: GTmetrix