keensoft/alfresco-simple-ocr

alfresco crash on action with multiple files

lupin3rd opened this issue · 2 comments

Hi,
thank you for alfresco-simple-ocr! Works very fine with alfresco 5.2.
If i run the rule on folders with few files all works fine, but if i run the rule on folder with lot pdfs alfresco crash... alfresco run a lot of pdfsandwich process, those fill RAM, processors go to 100%, then became to swap and alfresco crash without complete the rule...
Any solution to specify how many process execute ???
Thank you very much and excuse for my bad english :-)

Probably your best choice is to install OCR software in another server. You have a guide for this at https://angelborroy.wordpress.com/2017/01/19/alfresco-installing-ocr-as-an-external-service/

I solve the problem with a little bash script:

#!/bin/bash

while true; do

if [ $(ps -ef | grep -v grep | grep pdfsandwich | wc -l) -lt 6 ]; then
        #execute pdfsandwich program
        pdfsandwich $1 $2 $3 $4 $5 $6 $7 &
        wait
        break
else
        sleep 5
fi

done

in my case i have seven arguments and i run pdfsandwich only if there are less then 6 pdfsandwich processes in execution.