[MAGNOLIA-9258] Exclude observation listeners from the config workspace from registering a EventListenerMBean Created: 19/Jan/24  Updated: 06/Feb/24  Resolved: 01/Feb/24

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 6.3.0

Type: Improvement Priority: Neutral
Reporter: Michael Duerig Assignee: Michael Duerig
Resolution: Done Votes: 0
Labels: dx-core-6.3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Epic Link: Throughput improvements
Work Started:
Approved:
Yes

 Description   

While working on MAGNOLIA-9181 I found that a vanilla CE instance registers 3463 observation listeners, 3421 of which are module configuration change listeners. When we profiled publication, we saw a lot of internal observation processing happening in Jackrabbit, maybe this was the cause. If so, we should think of a leaner mechanism for modules to listen to configuration changes.

Discovery

  • This was already discussed at the DX Core Performance: weekly sync 3: the recording has some good ideas from mgeljic at the beginning:
    • deprecate/remove JCR configurations
    • make observation lass fine granular (with this one we have to take care not to move the bottleneck from processing the events within Jackrabbit to within Magnolia).
  • OTOH, all the listeners are registered on the config workspace, while publishing pages happens on website. From looking at the code Jackrabbit is clever enough to not spend much time processing observation pertaining to different workspaces. We might want to confirm this through some profiling though.
    • When publishing a page there's only a few listeners invoked: logs like 2024-01-19 15:15:13,667 DEBUG .jackrabbit.core.observation.ObservationDispatcher: event delivery to 3 consumers started... appear a few times.
    • Configuration changes however cause many listeners to be invoked: 2024-01-19 15:18:40,478 DEBUG .jackrabbit.core.observation.ObservationDispatcher: event delivery to 2012 consumers started...
  • I couldn't see a significant negative impact on performance from these listeners. The only thing that shows up are many calls to org.apache.jackrabbit.commons.observation.ListenerTracker#recordOneSecond. To mitigate this and avoid cluttering the monitoring I suggest to exclude the EventListenerMBean registrations for the config workspace. 


 Comments   
Comment by Michael Duerig [ 01/Feb/24 ]

Documentation for this ticket is included here: https://jira.magnolia-cms.com/browse/MAGNOLIA-9181?focusedId=393463&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-393463

Generated at Mon Feb 12 04:40:03 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.