Expand my Community achievements bar.

SOLVED

Adjusting Sling's includes/request limit

Avatar

Level 4

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?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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-4B447C1...x/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3E

View solution in original post

3 Replies

Avatar

Correct answer by
Employee Advisor

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-4B447C1...x/sling-users/201202.mbox/%3C4A309956-28F4-4080-88A8-4B447C188BF7@adobe.com%3E

Avatar

Level 4

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

Avatar

Level 2

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