cancel
Showing results for 
Search instead for 
Did you mean: 

Response time of REST API for Workflow Tasks fetched

rahulsovani
Champ in-the-making
Champ in-the-making
Hi,

We have setup Alfresco Community 4.2.b, installed on a VM, with Xeon 2.13GHz, 8 GB of RAM and Windows 2008 Server (64 Bit); the database (Postgresql) is setup on a different VM of same configuration.

There is one tenant created and a custom workflow deployed in it under the Data Dictionary/Workflow in tenant space; we initiated around 700+ workflows (of custom type).

When loading the tasks using the REST APIs (/alfresco/s/api/task-instances), we observed the results (around 700 tasks)
* take around 40 to 75 seconds without any parameters.
* with skip (=0) and maxItems (=10) there is no major difference in response times, ranges from 40 - 75 seconds.

Would request suggestions and inputs on the possible causes and solutions for the same, is there a possibility that the filters are applied after pulling all the task objects?


Thanks,
Rahul.
3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
Hello,

yes, a majority of the filters including the pagination are applied post-retrieval and thus will not reduce the effort the load the basic result set. The reason filters are applied post-retrieval is due to the architecture of Alfresco workflows, which can basically aggregate workflows from different sources (i.e. embedded jBPM and Activiti, but potentially any other workflow / task engine one might want to integrate) and needs to apply the filters uniformely across the whole collection of results.

It is very much advised to include the "authority" filter in any query to task-instances which can be the most effective filter since it is applied directly in the query and not post-retrieval. Also specifying a "state" can help a lot, especially if you have amassed a large volume of completed tasks and only need the active ones.

Regards
Axel

rahulsovani
Champ in-the-making
Champ in-the-making
Thanks for the clarification Axel.

We have the authority and state filter in place and the response is ranging from 25-40 seconds for around 160-227 tasks for the user/authority specified.
Can you please suggest some method where we can further reduce the response time, either by handling the configuration of Alfresco or the DB, or can we introduce some custom code to query?

Thanks,
Rahul.

afaust
Legendary Innovator
Legendary Innovator
Hello,

apart from specifying the properties you absolutely need in the response to reduce the size (and construction time) of the response, there are no further client-provided options available that directly influence the performance. You could / should check if the connection from Alfresco to the datbase is performing within acceptable parameters and the database statistic / cleanup processes are regularily executed. Since you have a lot of tasks, it may be that the query plan is not as efficient as it could possibly be.
As I currently have no system available where a single user has access to that many tasks at one time, I can't check for some rudimentary comparative data right now.

Writing you own ReST API operation is definitely an option to get the best performance for your specific use case. The operation you are calling right now was designed with a manageable amount of collaborative tasks per user in mind (manageable = user does not drown, e.g. <=~50 tasks). We have in the past written our own variants to support additional features (i.e. filter by task type, not just workflow type) which also helped to reduce the result set and thus improve performance.

Regards
Axel