You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Roll, Kevin" <Ke...@idexx.com> on 2015/12/15 18:27:06 UTC

Old jobs in repository

Our application depends on a lot of lightweight jobs that run quickly. During field trials we have encountered several instances where the backing database for Sling (MS SQL Server) filled up to its maximum capacity of 4Gb. I have one of these machines in front of me and I've discovered that the repository is clogged up with old jobs under the /var/eventing/jobs node. The number of jobs is practically uncountable but is potentially in the millions given the number of rows in the DEFAULT_BUNDLE table. The majority of jobs are under the 'cancelled' node but there are also some under the 'unassigned' node. This raises many questions:

* Why are CANCELLED jobs persisted in the repository? Shouldn't they just go away?
* Why would unassigned jobs from many days ago be sitting there? Could anything block the job queue from processing them?
* The jobs are stored under a node structure that uses the year/month/day/hour/etc. Does this ever get cleaned up? This node structure would continue to grow indefinitely, consuming more space.
* Is there anything I can do to clean up all these old jobs without destroying the rest of my repository?

I should also mention that despite the presence of all these nodes, the Sling Jobs status page shows zero for all counters.

Thanks as always, everyone!


RE: Old jobs in repository

Posted by "Roll, Kevin" <Ke...@idexx.com>.
That is great news! I will look into running a task which kicks off this job.

That does not, however, answer the question of why the old jobs are there in the first place.

-----Original Message-----
From: Stefan Seifert [mailto:sseifert@pro-vision.de] 
Sent: Tuesday, December 15, 2015 3:10 PM
To: users@sling.apache.org
Subject: RE: Old jobs in repository

there is a built-in job consumer to cleanup historic job data from the repository, this should include cancelled jobs.
it's not active by default.

you can use the job api to run this job - example:

String JOB_HISTORY_CLEANUP_TOPIC = "org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask";

Map<String, Object> jobProperties = new HashMap<String, Object>();
jobProperties.put("age", maxAgeMinutes);
jobManager.addJob(JOB_HISTORY_CLEANUP_TOPIC, jobProperties);


you can runs this e.g. once a day. depending on maxAgeMinutes all job data older that this timespan is cleaned up.

empty "folder structures" for years/month/day etc. should get cleaned up automatically from time to time.

stefan


>-----Original Message-----
>From: Roll, Kevin [mailto:Kevin-Roll@idexx.com]
>Sent: Tuesday, December 15, 2015 6:27 PM
>To: users@sling.apache.org
>Subject: Old jobs in repository
>
>Our application depends on a lot of lightweight jobs that run quickly.
>During field trials we have encountered several instances where the backing
>database for Sling (MS SQL Server) filled up to its maximum capacity of
>4Gb. I have one of these machines in front of me and I've discovered that
>the repository is clogged up with old jobs under the /var/eventing/jobs
>node. The number of jobs is practically uncountable but is potentially in
>the millions given the number of rows in the DEFAULT_BUNDLE table. The
>majority of jobs are under the 'cancelled' node but there are also some
>under the 'unassigned' node. This raises many questions:
>
>* Why are CANCELLED jobs persisted in the repository? Shouldn't they just
>go away?
>* Why would unassigned jobs from many days ago be sitting there? Could
>anything block the job queue from processing them?
>* The jobs are stored under a node structure that uses the
>year/month/day/hour/etc. Does this ever get cleaned up? This node structure
>would continue to grow indefinitely, consuming more space.
>* Is there anything I can do to clean up all these old jobs without
>destroying the rest of my repository?
>
>I should also mention that despite the presence of all these nodes, the
>Sling Jobs status page shows zero for all counters.
>
>Thanks as always, everyone!


RE: Old jobs in repository

Posted by Stefan Seifert <ss...@pro-vision.de>.
there is a built-in job consumer to cleanup historic job data from the repository, this should include cancelled jobs.
it's not active by default.

you can use the job api to run this job - example:

String JOB_HISTORY_CLEANUP_TOPIC = "org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask";

Map<String, Object> jobProperties = new HashMap<String, Object>();
jobProperties.put("age", maxAgeMinutes);
jobManager.addJob(JOB_HISTORY_CLEANUP_TOPIC, jobProperties);


you can runs this e.g. once a day. depending on maxAgeMinutes all job data older that this timespan is cleaned up.

empty "folder structures" for years/month/day etc. should get cleaned up automatically from time to time.

stefan


>-----Original Message-----
>From: Roll, Kevin [mailto:Kevin-Roll@idexx.com]
>Sent: Tuesday, December 15, 2015 6:27 PM
>To: users@sling.apache.org
>Subject: Old jobs in repository
>
>Our application depends on a lot of lightweight jobs that run quickly.
>During field trials we have encountered several instances where the backing
>database for Sling (MS SQL Server) filled up to its maximum capacity of
>4Gb. I have one of these machines in front of me and I've discovered that
>the repository is clogged up with old jobs under the /var/eventing/jobs
>node. The number of jobs is practically uncountable but is potentially in
>the millions given the number of rows in the DEFAULT_BUNDLE table. The
>majority of jobs are under the 'cancelled' node but there are also some
>under the 'unassigned' node. This raises many questions:
>
>* Why are CANCELLED jobs persisted in the repository? Shouldn't they just
>go away?
>* Why would unassigned jobs from many days ago be sitting there? Could
>anything block the job queue from processing them?
>* The jobs are stored under a node structure that uses the
>year/month/day/hour/etc. Does this ever get cleaned up? This node structure
>would continue to grow indefinitely, consuming more space.
>* Is there anything I can do to clean up all these old jobs without
>destroying the rest of my repository?
>
>I should also mention that despite the presence of all these nodes, the
>Sling Jobs status page shows zero for all counters.
>
>Thanks as always, everyone!


Re: Old jobs in repository

Posted by "Street, Brian" <br...@twcable.com>.
We recently enacted a workflow to clean up old jobs to improve author instance performance.  We are using TarMK for persistence, but our repo is on the order of 20GB in size.
We have noticed we need to run OAK offline compaction jobs with AEM6.1 because the repository does appear to grow faster than under CQ5.6.1.


From: <Roll>, Kevin <Ke...@idexx.com>>
Reply-To: "users@sling.apache.org<ma...@sling.apache.org>" <us...@sling.apache.org>>
Date: Tuesday, December 15, 2015 at 10:27
To: "users@sling.apache.org<ma...@sling.apache.org>" <us...@sling.apache.org>>
Subject: Old jobs in repository

Our application depends on a lot of lightweight jobs that run quickly. During field trials we have encountered several instances where the backing database for Sling (MS SQL Server) filled up to its maximum capacity of 4Gb. I have one of these machines in front of me and I've discovered that the repository is clogged up with old jobs under the /var/eventing/jobs node. The number of jobs is practically uncountable but is potentially in the millions given the number of rows in the DEFAULT_BUNDLE table. The majority of jobs are under the 'cancelled' node but there are also some under the 'unassigned' node. This raises many questions:

* Why are CANCELLED jobs persisted in the repository? Shouldn't they just go away?
* Why would unassigned jobs from many days ago be sitting there? Could anything block the job queue from processing them?
* The jobs are stored under a node structure that uses the year/month/day/hour/etc. Does this ever get cleaned up? This node structure would continue to grow indefinitely, consuming more space.
* Is there anything I can do to clean up all these old jobs without destroying the rest of my repository?

I should also mention that despite the presence of all these nodes, the Sling Jobs status page shows zero for all counters.

Thanks as always, everyone!



________________________________

This E-mail and any of its attachments may contain Time Warner Cable proprietary information, which is privileged, confidential, or subject to copyright belonging to Time Warner Cable. This E-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this E-mail is strictly prohibited and may be unlawful. If you have received this E-mail in error, please notify the sender immediately and permanently delete the original and any copy of this E-mail and any printout.