Monitor Your Site Post-Launch
Learning Objectives
After completing this unit, you’ll be able to:
- List the areas you can monitor in Business Manager.
- Explain why understanding the infrastructure can help you troubleshoot problems.
- List the types of problems that show up in the Log Center.
- Describe two ways to avoid concurrent database operations.
- Explain the importance of quotas.
- List optimization best practices.
Monitor Post-Launch
As you wrap up a project, always initiate a post-launch monitoring program and get ready to troubleshoot different types of issues. It’s important that you monitor a site from day one. Continuous monitoring ensures peak performance, limited downtime, repeat shoppers, and a happy merchant.
Start by monitoring these areas in Business Manager.
Parameter/Tool |
Tips |
Business Manager Path |
|
Administration > Operations > Service Status |
|
|
Administration > Site Development > Development Setup |
|
|
Administration > Operations > Quota Status |
|
|
Administration > Site Development > Development Setup |
|
|
Administration > Operations > Jobs |
|
See the next unit. |
Where Do I Look?
It helps to know where to look for help when problems occur. Here’s where you can start.
Area to Consider | Helps You Understand | Learn More |
Infrastructure |
How the various components work together |
|
Session ID/request ID |
How to track requests and sessions |
|
Log files/Log levels |
How to glean important information from the log files |
|
Remote includes |
Additional application server requests |
|
Web adapter log files |
In-depth details about web adapter requests |
|
Staging problems |
How to identify and correct staging problems |
|
Salesforce B2C Commerce performance |
How to monitor new code after deployment to identify and prevent performance problems |
|
Database churn |
How spikes in database operations can relate to creating, updating, and deleting objects in a database |
Holiday Season Readiness with Salesforce B2C Commerce, the Clean Up Storefront Data unit |
Reporting to customer support |
Who to notify about specific types of issues and how to notify them |
Log Center
Do you have large log files? That can mean underlying issues such as these.
- Scripting errors
- Unhandled exceptions
- Poor coding
- Service errors
- Job errors
- Missing files/content assets
- Quota violations
- Deprecation warnings
Dig deeper into the log files to determine the problem. These system limitations can cause errors in Log Center.
- Video files are limited to 20MB. B2C Commerce supports download and play video formats such as Flash, Windows Media, and QuickTime.
- Emails are limited to 3MB. After sending an email via B2C Commerce, you might receive an error in the logs, indicating that your email message is too large and the email failed to send.
- Templates are limited to 10MB. If the generated output of an ISML template exceeds that, the page processing is canceled with an exception.
- The default B2C Commerce script timeout is 30 seconds.
Do you use on-demand sandboxes? Their log messages are collected in a dedicated Log Center (credentials required). You can view the logs for the realms for which you have access based on your role.
Quotas and Performance
Quotas act as guardrails, keeping a B2C Commerce site fast and functional by monitoring resource usage in custom code. Resources include memory, application server threads, database table sizes, and more. When a quota is exceeded, it typically means that custom code uses supported capabilities inefficiently; a more efficient solution is possible.
The quota status in Business Manager is aggregated across all application servers of the instance. B2C Commerce updates an object’s quotas status with an up to 20-minute delay. It checks object relation quotas and updates status when relations are modified, not when they are traversed (navigated). Business Manager shows the status of object relation quotas and API quotas for the last 24 hours or since the server started.
Here’s how to view quota data.
- Open Business Manager.
- Select Administration > Operations > Quota Status.
- Drill down into a quota to see more details.
Quota status is color-coded.
- Green/ok = OK
- Orange/warning = Near Quota Limit
- Red/error = Action Required
Object quotas are organized into functional categories such as A/B Test, Catalog, Checkout, Content, and Customer. Object quotas and their relation quotas define the limit on the number of objects. Object quotas typically limit the number of objects of a particular type per instance, while object relation quotas limit the number of objects that can be associated with one object of that type. For example, within the Catalog
object, Sub-Categories per Category
is an object relation quota that enforces a limit of 1,000 subcategories per category, with a warning at 600.
Quota Overrides
Salesforce Operations enforces quotas by default on all instances. B2C Commerce Support can soften quotas on primary instances (production, staging, and development) by resetting them from error
to warn
. To use the same (softened) quotas on a sandbox (for testing), export those quotas from a production instance and import (overwrite) them onto a sandbox instance. The merchant needs to have a valid reason to do this—and must get approval—because it can impact performance.
Web Services Issues
You might have problems with a site’s web services. But you can do a lot to help your merchant prevent them from happening in the first place. Here are some suggestions.
In Business Manager, make sure that:
- The cartridge containing your script is in the cartridge path.
- The web service is enabled.
- The web service is set to Live and not Mocked.
In the source code editor (UX Studio or Visual Studio Code), make sure that:
- You point to your initialization script in your package.json.
- The initialization script has a service definition for your web service.
- The service definition includes callback objects that handle the web service response.
- You have written a script that calls your web service.
- Your web service is available.
Database Concurrency
Sometimes data updates happen from too many places at the same time, for example, where an order status is updated from the storefront at the same time that it’s being updated by a job. Performance degrades as servers try to honor both requests. Here are some ways you can avoid such concurrent requests.
Method |
Suggestions |
Optimistic concurrency control |
|
Optimistic control attributes (OCA) on table records |
|
To avoid optimistic locking altogether, split the processing of a large number of records into several transactions.
Optimization Best Practices
The best practice is to build performance into an application. Some sites, however, need best practice guidance such as what’s listed here.
Architectural Area |
Best Practices |
Client code |
|
Server |
|
Third-party integrations |
|
Next Steps
In this unit, you learned the importance of monitoring your site on day one. You learned where to look to help resolve problems and what questions to ask. Next, learn how to monitor and troubleshoot production performance.
Resources
- Trailhead: Assess Site Performance with B2C Commerce Reports & Dashboards
- Trailhead: Salesforce B2C Commerce Customer Support
- Trailhead: Salesforce B2C Commerce Scheduled Jobs
- Salesforce Help: Governance and Quotas
- Salesforce Help: Log Center
- Salesforce Help: Configure the Embedded CDN
- Salesforce Help: Use the Web Adapter Cache Key Ignore Feature Switch
- External link: CloudFlare: Why use TLS 1.3? | SSL and TLS vulnerabilities
- External link: CloudFlare: TLS 1.3
- External link: CloudFlare: A Detailed Look at RFC 8446 (a.k.a. TLS 1.3)