In the Governor limits, there is the following limit:

Number of synchronous concurrent transactions for long-running transactions that last longer than 5 seconds for each org.

If i create a custom Apex REST resource (e.g. using @RestResource(urlMapping='/whatever/v1/*') annotation), and inside this resource in the actions i run some heavy SOQL queries, and i have a few thousand users call this API all at once (they do it via a mobile app in the field), and it so happens that some requests take longer than 5 seconds, are those considered long-running transactions?

Does it mean other users will be denied (what it says on the same page)?

1 Answer 1


Yes. The system will observe that there are too many requests over 5 seconds long and deny any further requests until the long-running ones complete. In that case, you'd need the client to retry.

  • So same limit does not apply to the standard query API, that has a different API limit on 25 requests with each taking more than 20 seconds? But it applies to Apex API?
    – zaitsman
    Jun 5, 2020 at 2:00
  • @zaitsman Right. Long-running transactions count for things like Visualforce, REST API calls, Lightning controllers, etc.
    – sfdcfox
    Jun 5, 2020 at 2:08
  • @sfdcfox I know it applies to custom webservice hosted via apex, but does it also applies to triggers running in backend when using composite apis? May 29, 2022 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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