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.
While most object quotas have a 20-minute delay, the Private Keys and Certificates quotas are updated every 24 hours.
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 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.
Select Administration > Operations > Quota Status 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.
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.
Quotas are enforced by default on all instances. Salesforce B2C Commerce IT can soften quotas as required on primary instances (PRD, STG, and DEV), by resetting them from error to warn. To use the same (softened) quotas on a Sandbox, export those quotas from a production instance and import (overwrite) them onto a Sandbox instance.
You can export quota settings from all instances. However, you can only import quota settings to Sandboxes. You can't import these settings into production instances.
On a Production instance, select Administration > Site Development > Site Import & Export.
In the Export section, under Data Units to Export, expand Global Data and select Custom Quota Settings.
Enter an archive name and select if you want the file to be saved in the global export directory (recommended).
To export the settings, click Export.
The job appears in the Status section. You can click the process link to view the log file. You can also download the log file.
To return to the Site Import & Export page, click << Back.
On a Sandbox instance, select Administration > Site Development > Site Import & Export.
Upload the file that you exported from the production system.
Select Local or Remote.
Browse to search.
To import the uploaded file, click Import.
The job appears in the Status section. You can click the process link to view the log file. You can also download the log file. Select Administration > Operations > Quota Status and view custom quota overrides on the Custom Quota Actions page.
If custom quota actions are active on an instance, a message appears on the Quota page.
You can view quota status and limits in the Administration module. Identify issues with your code and correct them before they cause significant problems.
You can also view Quota violations in the Quota log file by selecting Administration > Site Development > Development Setup > WebDAV Access section > Log files.
Select Administration > Operations > Quota Status.
On the Quota page, review the Custom Quota Actions section to see if any custom quota actions are active on the instance.
To view details, expand a quota.
On the Custom Quota Actions page, review the API quota limits and current usage for the quota elements that are of concern to you. Pay attention to any elements that appear in red or orange. Every quota is color-coded:
|Orange|Warning / Near Quota Limit| |Red|Error / Action Required|
If you are using a Sandbox, database size limit and current usage are displayed in the Database Usage section.
The API values reflect the last 24 hours only.
To send out a daily summary of all quotas that are in violation, add any email addresses, and select Enabled.
When a quota is violated, an email is sent to all recipients defined in this field.
Recipients can be a single email address or a list of comma-separated email addresses. To save these settings, click Apply. To revert to the initial values, click Reset.
Quota log files aggregate quota messages over a set period. Messages are written when the warn threshold or limit of a quota is exceeded.
The code location of the most recent event is written to the log file. The code locations of the aggregated events aren’t exposed. Quota log files show information about the location where a quota-warn threshold or limit was exceeded. The information includes the site name, job name, and top pipeline name. Additional information is sometimes included about the executed pipelet, script, pipeline node, and template.
Quota log files use this general format:
- a timestamp
- the thread name (contains type of request, site, pipeline name, and other parameters)
- the actual message
This format produces log entries such as the following:
[2012-05-23 13:00:22.577 GMT] [RequestHandlerServlet|14320460|Sites-SiteGenesis-Site|Product-Show| PipelineCall|pRLNN0PXCp7rqIClq7IcPUvuEEjtkOWUAMBdUWhniPRFlV4Xvim3HwhDw96bRZ7e5BUxhnkC2ExrVYZVBFLJtw==] Quota api.jsStringLength (enforced, warn 600000, limit 1000000): warn threshold exceeded 1 time(s), max actual was 600010, current location: request/site Sites-SiteGenesis-Site/top pipeline Product-Show/ interaction node/template refapp.default_.CustomDisplay
This section of the entry is the timestamp:
[2012-05-23 13:00:22.577 GMT]
This section of the entry is the internal reference:
This section of the entry is the message:
Quota api.jsStringLength (enforced, warn 600000, limit 1000000): warn threshold exceeded 1 time(s), max actual was 600010, current location: request/site Sites-SiteGenesis-Site/top pipeline Product-Show/interaction node/template refapp.default_.CustomDisplay
The message contains details to help identify problems. You can see:
- If a quota is enforced or not enforced
- If applicable, the warn threshold
- The limit
- The number of times since the last log entry for this quota that the warn threshold or limit was exceeded
- The highest observed reading (max actual)
- The current location, which shows where the warn threshold or limit was exceeded
Read-only quotas don't have a warn threshold or limit, for example, Quota object.ProductPO.readonly@SF (enforced).