<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Lots of timer tasks, slow lock acquisition times in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198095#M151225</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Id like to know if this approach is feasible and I'll try to keep this first post simple. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Requirements call for recurring processes which wait and trigger at configurable intervals (weekly, monthly, yearly, etc). 10M+ active processes exist, with 50-100k becoming candidates any given day, each having the same ISO timestamp (current timestamps in legacy system are day precision). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had some questions about load so I wrote a couple simple tests which yielded these results, which surprised me. This was done using a quad-core i7 with 16GB ram and MySQL 5.6, using simple process with a timer task that calculates the next date and loops and then waits and so on. The quality on this bites but it was the first hosting site I found &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://postimg.org/image/vj748msh5/" rel="nofollow noopener noreferrer"&gt;http://postimg.org/image/vj748msh5/&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Candidates&amp;nbsp; Total Records&amp;nbsp;&amp;nbsp;&amp;nbsp;Lock Acquisition Time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;50k &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~330ms&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;50k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~4s&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;50k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~2m&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Candidates are process instances that have a trigger time that is less than the current time. Total records include active candidates, plus process instances with trigger times in the future. I wrapped the AcquireJobsCmd execution with a timer to obtain these numbers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I notice no indexes exist on the ACT_RU_JOB table, by adding some indexes on DUEDATE_ and LOCK_EXP_TIME_ I was able to speed up the query dramatically, obtaining ~14s for a 10M record table. But, this may have other undesirable side effects and this is still much slower than I would expect to obtain a lock to execute a process…so this was just an experiment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In theory, should Activiti be able to handle this better? Or is the approach flawed in the first place? Other options exist, but it's very tempting to have one product do all the queuing and locking work for us &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; especially since it seems to be integral to the process flow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any input!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 21:29:17 GMT</pubDate>
    <dc:creator>kirkb75</dc:creator>
    <dc:date>2014-06-23T21:29:17Z</dc:date>
    <item>
      <title>Lots of timer tasks, slow lock acquisition times</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198095#M151225</link>
      <description>Id like to know if this approach is feasible and I'll try to keep this first post simple. Requirements call for recurring processes which wait and trigger at configurable intervals (weekly, monthly, yearly, etc). 10M+ active processes exist, with 50-100k becoming candidates any given day, each havin</description>
      <pubDate>Mon, 23 Jun 2014 21:29:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198095#M151225</guid>
      <dc:creator>kirkb75</dc:creator>
      <dc:date>2014-06-23T21:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of timer tasks, slow lock acquisition times</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198096#M151226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting experiment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering though where is the bulk % of the time being spent? Is it the job executor? Is it the execution of the sub process?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you start this process? Is it just one? Do you spawn one for every of your entries?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The numbers do seem high, so Im sure there is optimization possible here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2014 09:05:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198096#M151226</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-04T09:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of timer tasks, slow lock acquisition times</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198097#M151227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey, thanks for the reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The bulk of the time is being spent in the job executor when trying to aquire new jobs, within the queries "selectNextJobsToExecute_mysql" and "selectExclusiveJobsToExecute_mysql". Extracting the actual queries and params out using debugging and running in a MySQL client yields very similar results, give or take a second.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The included sub-process is a no-op that was just added for testing, just a simple log statement. Changing it to a script task and/or removing it yields the same overall result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For brevity I've simplified the code below, but the processes are started by essentially the following inside of a java class (main and/or embedded in a webapp).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for(int i = 0; i &amp;lt; numProcesses; i++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; final Map&amp;lt;String, Object&amp;gt; variableMap = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; variableMap.put("ID", String.valueOf(i));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; variableMap.put("nextDate", isoDateString);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; runtimeService.startProcessInstanceByKey("testProcess", String.valueOf(i), variableMap);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also noticed that when starting up a new node in a cluster and deploying processes, there is a "selectJobsByConfiguration" query which gets executed, which also results in a very long startup time for the process being deployed in a new JVM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 16:45:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198097#M151227</guid>
      <dc:creator>kirkb75</dc:creator>
      <dc:date>2014-07-09T16:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of timer tasks, slow lock acquisition times</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198098#M151228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there some way you could share your test code for this? I would like to see and interprete the results for myself.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 06:43:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lots-of-timer-tasks-slow-lock-acquisition-times/m-p/198098#M151228</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-22T06:43:49Z</dc:date>
    </item>
  </channel>
</rss>

