tracker issue : CF-4205489

select a category, or use search below
(searches all categories and all time range)

Potential for thousands of Redis calls every 5 seconds when monitoring sessions with PMT

| View in Tracker

Status/Resolution/Reason: To Fix//Fixed

Reporter/Name(from Bugbase): Michael F. / ()

Created: 10/21/2019

Components: PMT, Non-Request Metrics

Versions: 2018

Failure Type: Performance Issue

Found In Build/Fixed In Build: Update 5 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Linux

Vote Count: 1

Problem Description: 

With FusionReactor, you have the ability to track Jedis. This is the library used to create and manage session storage in ColdFusion if you have Redis session management configured, rather than in Memory sessions.

You see that with FusionReactor, there appears to be a function that makes one Redis call for every single session in Redis. This occurs every 5 seconds.

If PMT is removed these Redis calls stop occuring.

With a single session you see there is one redis call every 5 seconds -

with 1000 active sessions there are 2000 redis calls every 5 seconds -

As soon as sessions expire the redis calls stop -

These are the redis calls being made -

Steps to Reproduce:
1. Configure CF 2018 with redis sessions
2. Add FR onto the CF 2018 (optional to give you easy visibility of the Redis calls)
3. Add the CF 2018 to PMT
4. Use Apache benchmark, Apache Jmeter or any other load simulation tool to push a given number of requests that create sessions into CF
5. Observer the active Redis queries

If you require any assistance on FR config email or me personally (I am the technical support engineer for FusionReactor).

Actual Result:
There is a potential for hundreds of thousands of calls to Redis every 5 seconds.
This has the potential to have a big impact on system performance as the number of sessions grows.

Expected Result:
There should not be this many calls to Redis every 5 seconds

Any Workarounds:



Michael, Do you happen to have thread dumps of the CF server, from when you simulated that behavior. That would make it easier to check the part of the code from where those calls are generating, in case one of those calls is captured in the dump.
Comment by Piyush K.
31808 | November 11, 2019 03:31:55 PM GMT
Hi, See Selection_577 this shows the profiler in an older version of FusionReactor where we call the Monitor class to retrieve the active session count. You can see that we make a reflection call to coldfusion.monitor.inmemory.InMemoryMonitoringServiceImpl.getActiveSessionCount() so we can gather the session metrics. In the profile if you follow the profile tree is the full profile you can see coldfusion.monitor.inmemory.InMemoryMonitoringServiceImpl.getActiveSessionCount() calls coldfusion.runtime.SessionTracker.getActiveSessionCount() which makes Jedis calls to Redis. This is the method call we can see makes one Redis call per active session. In a later version of FusionReactor, where we stopped calling the Monitor.getActiveSessionCount() so we were not making any calls to Redis, we took a stack trce of all threads and see the stack trace: " Method) redis.clients.util.RedisOutputStream.flushBuffer( redis.clients.util.RedisOutputStream.flush( redis.clients.jedis.Connection.flush( redis.clients.jedis.Connection.getBinaryMultiBulkReply( redis.clients.jedis.BinaryJedis.hgetAll( coldfusion.runtime.session.external.RedisSessionStorage.getSessionCount( coldfusion.runtime.SessionTracker.getSessionCount( coldfusion.monitor.scheduler.NonRequestTask.updateSessionData( coldfusion.monitor.scheduler.NonRequestTask.collectNonRequestMetrics( java.util.concurrent.Executors$ java.util.concurrent.FutureTask.runAndReset( java.util.concurrent.ScheduledThreadPoolExecutor$ java.util.concurrent.ThreadPoolExecutor.runWorker( java.util.concurrent.ThreadPoolExecutor$" Please let me know if there is anything else you need.
Comment by Michael F.
31809 | November 11, 2019 04:47:54 PM GMT
Any word on this, Adobe folks?
Vote by Charlie A.
31890 | November 27, 2019 09:03:09 PM GMT
Hi All, We are looking into this issue. Thanks, Mayur Jain
Comment by Mayur J.
31889 | November 28, 2019 07:45:00 AM GMT
this is fixed.. it'll be made available in a future CF2018 update. If you need a dedicated patch, pls reach out to the support.
Comment by Piyush K.
33266 | March 06, 2020 05:19:33 PM GMT