cancel
Showing results for 
Search instead for 
Did you mean: 

Limit number of running jobs

Former Member
0 Kudos

Hi there,

I'm looking for some time on the wiki/experts about a way to limit the number of concurrent running cron jobs in hybris. Reason is that at some point, there are 5 or 6 big jobs running, making the other parts of the system inaccessible. The idea would be to put all the extra jobs in FIFO queue.

I already found a Spring alternative to this with the TaskExecutor ( ThreadPoolTaskExecutor ); but I wonder if 1. Hybris integrates a factory default way ; 2. How to integrate it properly?

Does anybody have an idea about this?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I would also explore the following:

  • Isolate your cron jobs and business processes to dedicated back-end nodes, do not excute these jobs storefront/customer facing nodes. A cronjob can be targeted to a particular cluster node.
    Business processes can be excluded through configuration (task.excluded.cluster.ids=1,2,3,etc). You can also specify nodes to not start the timertask (cluster..cronjob.timertask.loadonstartup=false)

  • You mention the lucene update cronjob. By default these get created for all nodes, and the execution time is aggressive (every minute for an update). The lucene cronjobs are only created for hmc quick search (not the normal type system search) - most customers rarely use this feature. These cronjobs can be easily disabled - and in the current version of hybris the lucene search was refactored into its own extension, and disabled by default.

Former Member
0 Kudos

isolate your cron jobs and business processes to dedicated back-end nodes,

Yep, that's what we already do, and so only the employees are impacted, not the customers.

These cronjobs can be easily disabled - and in the current version of hybris the lucene search was refactored into its own extension, and disabled by default.

We'll try that, thanks for the tip!

Former Member
0 Kudos

Just time your cron jobs accordingly and define triggers accordingly when you want to make them run. You can use regular expressions to control which day, hour or minutes. This is the best practice.

Former Member
0 Kudos

Hi Romain

You might consider using CompositeCronJob solution.

Former Member
0 Kudos

The problem is that the jobs have noting to do between each other. For example, you will have Lucene Update running, Media import running, Provider import running, Order export running. As far as I understand, composite cron job is for splitting a whole process in an amount of smaller steps depending on the previous one. Here, the idea is simply to say: if we have 2 jobs running, the third will wait one of the two to be finished before executing...

Former Member
0 Kudos

As far as I understand, composite cron job is for splitting a whole process in an amount of smaller steps depending on the previous one.

I think it's not, here's what the article says:

When the CompositeCronJob is run, then the individual entries are executed sequentially and independently of one another, in the order specified by the compositeEntries attribute. If one entry has finished the execution, the next entry is executed, whether the finished entry has completed successfully or not.

Former Member
0 Kudos

You're right, but it means that the jobs must be in a row, no? I heve the problem that, for example, Lucene Index runs every day at 3 am (until 9am) Order export runs every 30 minutes Media load runs every 4 hours (for 1 hour or so) Provider import jobs are running every few hours for some time (depending on the provider and the amount of data) So it's not a good solution to gather all of those in one single "row", each must execute according to the needs...

Former Member
0 Kudos

Agree... It doesn't fit your requirements.

Former Member
0 Kudos

Thanks anyway for the disscussion ;-)

Former Member
0 Kudos

On my previous project we scheduled heavily-loaded cronjobs in such a way that they do not interfere.

So may be you can play around with scheduling.

Former Member
0 Kudos

Probably the best to do, yes ...