Governance and Quotas
B2C Commerce includes constraints and limits to ensure the efficiency and stability of solutions built on the platform. These limits concern memory usage, resource consumption, API calls, and the number of business objects. Quotas are used to monitor resource usage in custom code. Resources include memory, application server threads, and database table sizes. Typically, when a quota is exceeded, custom code is using supported capabilities inefficiently, and a more efficient solution is possible.
The quota status is aggregated across all application servers of the instance. Object quotas status is updated with an up to 20-minute delay. Object relation quotas are checked and status is updated when relations are modified, not when they are traversed. The status of object relation quotas and API quotas is shown for the last 24 hours or since server start.
What Happens When a Quota Is Exceeded?
All API Object quotas have a default action, as follows, that occurs at the instance level (PRD, STG, DEV, Sandbox).
Action | Quota Type | B2C Commerce Function | Recommended Action |
---|---|---|---|
log_only | In the evaluation stage (by Salesforce). | Report usage levels against the quota limit within quota log-files (only). | Ignore the reported information for now. |
warn | A valid indicator of potential performance or stability concerns. | Report usage levels against the quota limits within quota log-files and within the Quota Status dashboard within Business Manager. | Take corrective action at the warning thresholds (60% of limit). B2C Commerce doesn't prevent usage beyond the error threshold (100% of limit). Consequential realm instability or non-performance can occur. |
error | A valid indicator of potential performance or stability concerns. | Report usage levels against the quota limits within quota log-files and within the Quota Status dashboard within Business Manager. | Take corrective action immediately. B2C Commerce prevents usage beyond the Error threshold (100% of limit), and prevents consequential realm instability or non-performance. |
B2C Commerce enforces API Object quotas for all new B2C Commerce realms. API Object quotas set to error are enforced on all instances (PRD, STG, DEV, Sandbox) unless they are softened (set to warn), as follows:
- For Production instances, only Salesforce Support can soften quotas.
- For Sandbox instances, you can soften quotas that are already softened in Production. Export them from a Production instance and import them to the Sandbox instance. This approach matches your Development environment to your Production environment.
A quota is either enforced or not enforced. If an enforced quota is exceeded, an exception is thrown, which prevents the current operation from completing. Do not catch quota violation exceptions within a customization. Instead, use avoidance of quota violations as a design criterion.
Examples of quota violations are:
- A collection with too many elements was created in memory
- Too many persistent objects of a certain type were created in an instance
If an enforced quota is exceeded in a storefront request, the general error page opens. If an enforced quota is exceeded during a standard import, a warning or error is reported. If a quota isn't enforced, B2C Commerce doesn't act when the limit is exceeded. B2C Commerce plans to enforce all quotas in the future.
Internal Quotas
Internal quotas are experimental or developmental in nature, and are not enforced. They donβt appear in Business Manager, and you can ignore log messages about them.
How Safe Is My Implementation
Select
for information about API and object usage levels, number of violations on an instance, and which quotas are enforced. Business Manager shows quota usage or violations since server restart or within the last 24 hours.With the proper permission, you can view details on:
- Object quotas status and limits
- Object relation quotas status and limits
- API quotas status and limits
- Sandbox system's database status
A quota status can be:
- green/ok = OK
- orange/warning = Near Quota Limit
- red/error = Action Required
Some quotas also specify a warning threshold, to give you an early indication that a quota limit is in danger of being exceeded.
When the warning threshold is exceeded and when the quota limit is exceeded, messages
are written to the quota log files. Messages are written for all quotas, enforced and
unenforced. The log files are written to the log files folder and have the prefix
quota.
Keep in mind that quota log files are written with a time
delay. The log files contain information about where the quota violation occurred. Also,
they can contain information about unenforced internal quotas that donβt appear in
Business Manager. You can safely ignore them.
Best Practices
Review the quotas and see how you can stay within the limits. For any quota exception,
the display shows Action required.
Unless a quota is enforced, no
action is required to fix an exception. However, you can use this real-time data (along
with the Quota Log Files) to assess your current API Object usage. For example, it can
help you troubleshoot a site that is experiencing performance issues. Check the quota
logs to help identify pipelines that exceed limits.