1

anyone can help me to understand this limit: Number of synchronous concurrent requests for long-running requests that last longer than 5 seconds for each organization

For Example, If the Apex Class - is invoked from the lighting component. below is the sequence of code execution in the Apex Class.

Public class MyClass{
    @AuraEnabled
    public static void myMethod(id recId){
        SOQL Query 
        Sycnhronous Callout to External System (Taking more than 4.5 Sec)
        DML (Taking 30 secs to perform DML).
    }
}

Scenario: SOQL Query took 30 sec to return records Callout to 4.8 Secs to respond. DML operation 20 sec.

Questions: Will the total transaction time for the callout is the sum of SOQL time + Callout Time + DML time (or) Callout time shouldn't be considered in the transaction time?

please do share some best practices must be considered to avoid the long-running transaction limits?

marked as duplicate by sfdcfox apex Nov 28 '18 at 7:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Check this link to find what all counts towards synchronous limits.

What counts against limits? enter image description here

Will the total transaction time for the callout is the sum of SOQL time + Callout Time + DML time (or) Callout time shouldn't be considered in the transaction time?

  1. The SOQL time is counted towards the 10 seconds so in your case it needs to be tuned. Try creating a custom index or optimize the search spec
  2. 4.8 seconds for callout is high. You may want to look at apex continuation if the callout time cannot be reduced since its counted as part of 10 seconds limits
  3. If you are doing DML statements the DB time is not counted against the 10 seconds but the triggers and other apex classes that may get called from trigger/Process builders will be counted so you may want to look at optimizing that as well.

One of our integrations had this callout time issue and because it was not critical we had to set timeout and terminate the transactions after 3 seconds. Callout is not a very recommended integration pattern as it holds the server thread till the response comes back check if you can do call back instead.

Also if 10 such requests are running on your production org then the 11 long running request will be denied.

Not the answer you're looking for? Browse other questions tagged or ask your own question.