AEM Bulk Replication allows you to activate a series of pages and/or assets.
How can we make sure workflow won’t impact AEM performance (CPU or Heap memory) / throttle the system?
Introduction:
AEM bulk replication or activation is performed on a series of pages and/or assets. We usually perform bulk replication on tree structures or lists of paths.
Use case:
MSM (Multi-site management) – rolling out a series of pages or site
Editable template – add/remove new components on template structure and activate existing pages
Bulk Asset ingests into the system
Bulk redirect//vanity path update
ACS Commons Throttled Task Runner is built on Java management API for managing and monitoring the Java VM and can be used to pause tasks and terminate the tasks based on stats.
Throttled Task Runner (a managed thread pool) provides a convenient way to run many AEM-specific activities in bulk it basically checks for the Throttled Task Runner bean and gets current running stats of the actual work being done.
OSGi Configuration:
The Throttled Task Runner is OSGi configurable, but please note that changing configuration while work is being processed results in resetting the worker pool and can lose active work.
Throttled Task Runner OSGi
Max threads: Recommended not to exceed the number of CPU cores. Default 4.
Max CPU %: Used to throttle activity when CPU exceeds this amount. Range is 0..1; -1 means disable this check.
Max Heap %: Used to throttle activity when heap usage exceeds this amount. Range is 0..1; -1 means disable this check.
Cooldown time: Time to wait for CPU/MEM cooldown between throttle checks (in milliseconds)
Watchdog time: Maximum time allowed (in ms) per action before it is interrupted forcefully.
JMX MBeans
Throttled Task Runner MBean
This is the core worker pool. All action managers share the same task runner pool, at least in the current implementation. The task runner can be paused or halted entirely, throwing out any unfinished work.
Throttled task runner JMX
How to use ACS Commons throttled task runner
Add the following dependency to your pom
Create a custom service or servlet as shown below:
Throttled Replication
inside the custom workflow process method check for the Low CPU and Low memory before starting your task to avoid performance impact on the system.
How to bulk replicate (Publish/Unpublish) pages in AEM using MCP?
Requirement:
Use bulk replication other than the OOTB tree activation tool and using MCP add a different replication agent instead of the default agent.
Introduction:
Usually for bulk replication we usually use the OOTB tree activation page and select the path to start the bulk replication i.e, activation only.
Activation Treestart path and activate
MCP provides an easier way and with better UI to run bulk activation. You can also create a separate replication agent other than default agent so that existing authoring replication or existing schedulers won’t be blocked.
You can use the MCP queue to replicate synchronously and the default queue to replicate asynchronously. For pages more than 10K its recommended to use MCP 10k Queue
Select the Tree Activation:
Go to MCP page url: http://{domain}/apps/acs-commons/content/manage-controlled-processes.html
Select Tree Activation process
Provide the path of the page and select all for “What to Publish” and MCP Queue based on your requirement.
Provide an agent if you are using a different agent for bulk replication and select action to bulk publish or unpublish the pages.
Can we Publish / Un Publish / Delete the list of pages mentioned in an Excel sheet?
Requirement:
This article discusses how to use the Manage Controlled Processes (MCP) dashboard in Adobe Experience Manager (AEM) to create a process for publishing, unpublishing, and deleting a list of pages in AEM based on an Excel sheet. The article provides code snippets for creating the ListTreeReplicationFactory service and implementation class called ListTreeReplication that reads the Excel sheet and performs the desired actions on the specified pages.
Create an MCP process to Publish / Un Publish / Delete the list of pages mentioned in an Excel sheet.
Introduction:
Usually, product owners or authors would like to Publish certain pages like offer/product/article pages based on business requirements and also would like to unpublish and delete to clean up the pages which are unnecessary.
This process will be really helpful during Excel sheet based migration.
MCP (Manage Controlled Processes) is both a dashboard for performing complex tasks and a rich API for defining these tasks as process definitions. In addition to kicking off new processes, users can also monitor running tasks, retrieve information about completed tasks, halt work, and so on.
Add the following maven dependency to your pom to extend MCP