cancel
Showing results for 
Search instead for 
Did you mean: 

Default Service Tasks

Former Member
0 Kudos

Hi Guys,

Few days I am searching, whether I can see where are defined the Default Service Tasks, what runs those Tasks and when.

Some task run permanently in few seconds and about two of them I want to find out why. Has somebody an Idea where are scheduled?

Thanks in advance!

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I ended up rewriting query with outer join & new indexes

 indexes: 
  idx1 (p_executiontimemillis,p_expirationtimemillis,p_nodeid,p_failed,p_runningonclusternode`),
  id2 (p_expirationtimemillis,p_failed,PK)
 
 SELECT {t.pk}
 FROM {Task AS t LEFT JOIN TaskCondition as c on {t.PK}={c.task}}
 WHERE
    {t.failed} = ?false AND
    (
       {t.expirationTimeMillis} < ?now OR
       (
          {t.executionTimeMillis} <= ?now AND
          ({t.nodeId} = ?nodeId OR {nodeId} IS NULL ) AND
          {t.runningOnClusterNode} = ?noNode AND
          ({c.PK} IS NULL OR {c.fulfilled} =?true)
       )
    )
 ORDER BY {executionTimeMillis} ASC
 
Former Member
0 Kudos

Thanks. Helps with performance on large tasks table

Former Member
0 Kudos

Hi, where did you put your rewritten query? I'm looking for the code in which the old query is but I can't find it. Do you remember where it is?

Thanks, Carmine

Former Member
0 Kudos

This is a very good hist, I also think a LEFT JOIN should more efficient than a NOT EXISTS.

I just wonder, maybe a DISTINCT should enforce unicity in case there is more than one fulfilled condition associated with the task.

Former Member
0 Kudos

Thank you. How I understand, the Task Engine runs statements, that check Tasks and Taskcondition tables in every 10 seconds for a new task records. So, we are not able to manage the execution time or to optimize the statements. Is it possible those two statements to worsen the database performance?

former_member447725
Participant
0 Kudos

Hi Rangel, Sorry, I'm not able to understand your post clearly. Can you please be a bit more brief or clear.

Former Member
0 Kudos

Yes, I am sorry. I will try to explain better my issue.

Two statements are running in every 10 seconds and select from tasks and taskconditions database tables(Please see the attached file link text). They are consuming a bit more time and the performance gets worse. Is it possible to be both somehow optimised.

Former Member
0 Kudos

Did you manage to get a solution for this. We are also facing the exact same issue.

Former Member
0 Kudos

I ended up rewriting query with outer join & new indexes

former_member447725
Participant
0 Kudos

Hi, Please find below the wiki documentation url from which you can understand tasks, their triggers and scheduling.

https://wiki.hybris.com/display/release5/task+-+Technical+Guide#task-TechnicalGuide-Scheduling

This could be handy to understand about tasks