cancel
Showing results for 
Search instead for 
Did you mean: 

'categories' crippling Alfresco performance

davidd
Champ in-the-making
Champ in-the-making
I'm running Alfresco Version: Community Network - v2.9.0 (B 683) on tomcat.

Whilst loading documents into a space with a custom presentation template, I found performance was being degraded.

Clicking on the space in Alfresco would cause Tomcat to run at 100% CPU and it could take 1 or two minutes (!) to display the space in question.
The more PDFs I added to the space, the worse things got, until finally you couldn't view the space at all - it would generate a TomCat proxy timeout error!

I found that by going into my presentation template and commenting out the lines which were displaying Categories, performance returned to normal.
Is this a known issue with catagories?
I found them very useful for tagging content with particular types of stuff, where a single metadata field would be inappropriate, as the document could fall in more than one category.

The culprit lines in the ftl file were:

  <td>
            <#if child.properties["custom:CustomerFacing"]?exists>
            ${child.properties["custom:CustomerFacing"]?string("Yes","No")}
            <#else>
            N/A
            </#if>
            </td>

            <td>
               <#– <@listSubCategories "Languages" child/>–>
            </td>

<td>
                <#–<@listSubCategories "Product name" child/>–>
            </td>

            <td>
              <#–  <@listSubCategories "Product version" child/>–>
            </td>
<td>
<#–<@listSubCategories "Product deployment type" child/>–>
</td>

          </tr>
   </#list>
</table>

<#macro listSubCategories catName child>
    <#list classification.getRootCategories("cm:generalclassifiable") as cat>
        <#if cat.name = catName>
            <#assign first="yes">
            <#list cat.subCategories as subCat>
                <#if subCat.immediateCategoryMembers?seq_contains(child)>
                    <#if first="no">
                        ,
                    </#if>
                    ${subCat.name}
                    <#assign first="no">
                </#if>
            </#list>
        </#if>
    </#list>
</#macro>


Is there anything bad looking in there?
2 REPLIES 2

hbf
Champ on-the-rise
Champ on-the-rise
I do not really know about the templates you are using. But in case they use Lucene PATH queries, you might want to take a look at PARENT queries to find documents under a category. For me, this turned out to be much, much faster.

I have posted about this in French, see the French forum.

Hope this helps,
Kaspar

davidd
Champ in-the-making
Champ in-the-making
well the categories bits in templates I am using are just taken from the standard presentation templates in the Data Dictionary
that ships with ALfresco, and the examples in the ALfresco book by Munwar Sharrif.
My French is rather weak, but I will try and read your thread… Smiley Happy