Programatically,I am copy some nodes(source node) and paste it on under parent node(destination node).When this process executing AEM consume more cpu usage its nearly goes 90% so AEM Slow down.
Session session = repository.loginAdministrative(null);
Workspace ws = session.getWorkspace();
It's hard to guess ...
Anyway, you upload ZIP files (which are extracted and the content is indexed then by the repository), plus the asset update workflow is running. That can take a while and consume quite some CPU, but should be async. The whole process of copying the assets itself should not take long.
ok, it seems that you are facing a number of issues....
of course duplicate UUIDs are not allowed; please try a different copy routine which does not copy all properties (as done by the workspace methods), but only the non-protected ones. For example the JcrUtils provided by AEM .
Regarding the performance: Depending on the size of the assets and some other (more infrastructure constraints) this copy action can move gigabytes... Can you tell us a bit about your setup and the size of the assets you want to copy?
Hi, Joerg hoh
"its getting slow" means when i copy above files under different parent node its taking time nearly 30 sec.As per our assumption it should take max 4-5 sec.When these files under in copy process java reach 90% cpu and again its come back to normal i.e. 3-6%.This happens six times because count of above files are six.
My machine configuration as below
system type-64 bit
AEM -AEM 6.4
ok, the size of the assets is not a problem.
Next thing: What do you mean by "is getting slow"? For how long is your AEM slow? Seconds, minutes or hours? Does it require a restart to recover?
Note: When new assets show up in the repository (and copying is a reason for it), the asset update workflow is starting which can be quite resourcen intensive, but which should only take seconds for the assets of the size you posted.
If it is really slow for some basic operations then feel free to raise a support ticket here: https://daycare.day.com/home/createaticket.html
with clear detailed use case to replicate the slowness and thread dumps if specific to your environment.
you can try different approach:
adminSession = repository.loginService("readService", null);
Node node = adminSession.getNode("/apps/nodePath/textfield");
Node parentNode = adminSession.getNode("/apps/parentNodePath");
JcrUtil.copy(node, parentNode, null);