Wednesday, October 10, 2018

Governor limits in salesforce

Governor limits are enforced to ensure that code runs correctly without any error. It is necessary to enforce governor limit since apex runs in a multitenant environment, multitenant here simply means a single instance of software runs on a server and serves multiple users at a time. The Apex runtime engine strictly enforces limits to ensure efficient performance.

Some of the important limits are mentioned below.


Description

Synchronous Limit

Asynchronous Limit

Max number of SOQL queries

100

200

Max number of records returned by SOQL queries

50,000

50,000

Max number of records returned by Database.getQueryLocator

10,000

10,000

Max number of SOSL queries

20

20

Max number of records from a single SOSL query

2,000

2,000

Max number of DML statements

150

150

Max number of records processed by DML statement

10,000

10,000

Max number of callouts (HTTP requests/web service calls) in a transaction

100

100

Max total time allowed for all callouts in a transaction

120 seconds

120 seconds

Max number of future methods per Apex invocation

50

0 in batch/future, 50 in queueable

Max number of Apex jobs in the queue with System.enqueueJob

50

1

Max heap size

6 MB

12 MB

 

Important HTTP Callouts Limits in Salesforce:


1. Maximum Number of HTTP Callouts per Transaction: 

A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call.

2. Timeout for Callouts:

  • The default timeout is 10 seconds.
  • custom timeout can be defined for each callout.
  • The minimum timeout is 1 millisecond and the maximum is 120,000 milliseconds (2 minutes).

3. Total Number of Callouts (HTTP Requests or Web Services Calls) per Transaction:

The total number of callouts (both synchronous and asynchronous) in a transaction is 100.

4. Inbound API Requests per 24-Hour Period:


The table below outlines the total inbound API request limits (calls) per 24-hour period for various Salesforce license types in Unlimited and Performance Editions:


Note: The API call limit includes inbound calls only. Outbound callssss (i.e. callouts) are only governed by the per transaction and maximum timeout limits.

License Type

API Requests per 24-Hour Period

Salesforce

5,000

Salesforce Platform

5,000

Lightning Platform - One App

200

Customer Community

0

Customer Community Login

0

Customer Community Plus

200

Customer Community Plus Login

10

External Identity (25,000 licenses)

70,000

External Identity (250,000 licenses)

750,000

External Identity (1,000,000 licenses)

4,000,000

Partner Community

200

Partner Community Login

10

Lightning Platform Starter

200 per member (for Unlimited and Performance Editions)

Lightning Platform Plus

5,000 per member (for Unlimited and Performance Editions)


Calculation Method:


The total number of inbound API requests allowed per 24-hour period is calculated as follows:
100,000 + (Number of Licenses x API Calls per License Type) + any purchased API Call Add-Ons.

 

5. Async Apex Callouts per Day: 2,50,000  

The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period is 250,000 or the number of user licenses in your org multiplied by 200, whichever is greater.

 

Platform Event Publishing and Delivery Limits:


  • Maximum number of platform events that can be publishedwithin one hour period is 2,50,000 for performance and unlimited editions.


Note: If you published multiple events in single transaction, the total number of events published in that transaction will be counted against the limit.


  • Total number of platform events that can delivered to subscribers in 24 hours period is 50,000.


Note: If single event is subscribed by multiple subscribers. Each subscription is counted separately against the delivery limit.

 

No comments:

Post a Comment