Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

SessionStatistics show no Stack Traces AEM 6.5.8

Avatar

Level 5

I noticed recently a slowdown in performance and went to check for Session leaks after almost 2 years of stability.  I noticed over 430 SessionStatistics but none have any values in the stacktrace field.  Shouldn't I be seeing the trace of what opened the Session?  What could this mean?

There are a ridiculous number of repository-reader-services and sling-scripting@sessions.

Another question, is there any side-effect if a user shared their login with 15 other people and they are all using the same user at the same time?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Stacktraces are only created when the total number of sessions exceeds 1000. Enabling it by default would impose a negative performance impact on opening any session.

 

But this value can be changed with the java system parameter "oak.sessionStats.initStackTraceThreshold", and you can set it to "0", so every session gets this stacktrace information.

 

See https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/...for it.

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @sdouglasmc 

 

We have seen similar issue with SessionStatistics object and it was making the instance very slow. We found there were few session leaks from Resource Resolver object not being closed and we were able to take care of those. We found this issue on AEM 6.5.7.0 and then upgraded also to 6.5.9.0.

 

Thanks!

Avatar

Community Advisor

Hi @sdouglasmc ,

 

As @Asutosh_Jena_ mentioned its most probably because of resource resolver object not being closed. I will suggest to use try-with-resources statement, that way you will never have them opened.

Your second question is related to sharing author instance credentials among team members? I would say, even if the application/product supports it, we should NEVER share credentials with anyone otherwise it will break the whole purpose of authentication and accountability.

Cheers!

Avatar

Level 5
 

Thanks guys, but that really isn't what I'm asking.  I found the issue that caused the problem (bad content, not good code to filter out bad content - created circular references). I know about closing RRs and Sessions.
My question is:Why can't I see actual stacktraces in the SessionStatistics details?  These would help show what opened the Session.

Avatar

Correct answer by
Employee Advisor

Stacktraces are only created when the total number of sessions exceeds 1000. Enabling it by default would impose a negative performance impact on opening any session.

 

But this value can be changed with the java system parameter "oak.sessionStats.initStackTraceThreshold", and you can set it to "0", so every session gets this stacktrace information.

 

See https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/...for it.

Avatar

Level 5

Beautiful, thanks for that.  I figured there would be a configurable value somewhere!