Adjusting Sling's includes/request limit | Community
Skip to main content
October 16, 2015
Solved

Adjusting Sling's includes/request limit

  • October 16, 2015
  • 3 replies
  • 4460 views

I am working on a query service project (similar to /bin/querybuilder.json), which uses <sling:include /> to recursively build JSON responses from many json.jsp views/templates.

Every component has its own template, including the page component, so this may result in MANY internal sling includes.  Consequently, we are seeing org.apache.sling.api.request.TooManyCallsException being thrown.  I've found the configuration for this limit:
org.apache.sling.engine.impl.SlingMainServlet->sling.max.calls=1500

I've increased the value, allowing us to get the large responses without causing the TooManyCallsException, but I'm not sure if there is a safe recommended max for this value.  I've set to 15,000 (10x our original value).  I understand the reason for this configuration value, but I'm not sure how critical this value is.

Will permitting 150,000 (100x the current value) be reckless and likely to cause AEM to fail?  Any documentation or advice around this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kunal_Gaba_

I guess the intent of having this was to limit the number of nested/recursive calls. In this case, you should be monitoring the JVM memory usage (especially the stack size) and tune it as per the needs. I don't think this should cause AEM to fail but you would be required to tune the JVM. 

https://issues.apache.org/jira/browse/SLING-601

https://mail-archives.apache.org/mod_mbox/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3Ex/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3E

3 replies

Kunal_Gaba_
Kunal_Gaba_Accepted solution
October 16, 2015

I guess the intent of having this was to limit the number of nested/recursive calls. In this case, you should be monitoring the JVM memory usage (especially the stack size) and tune it as per the needs. I don't think this should cause AEM to fail but you would be required to tune the JVM. 

https://issues.apache.org/jira/browse/SLING-601

https://mail-archives.apache.org/mod_mbox/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3Ex/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3E

October 16, 2015

Hi kunal23,

Thanks for responding.  I had seen the second link, but the first is new to me.
I appreciate that you've pointed to these references, but I'm still hoping that somebody can provide a first hand account of what they have found to be reasonable limits.

Thank you,
Dave

khakiout
Level 2
July 19, 2016

Thanks for this. Although, I would like to know as well the repercussions of increasing the max number of calls.