keensoft / alfresco-simple-ocr

Simple OCR action for Alfresco
Other
44 stars 30 forks source link

alfresco crash on action with multiple files #27

Closed lupin3rd closed 7 years ago

lupin3rd commented 7 years ago

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 :-)

angelborroy-ks commented 7 years ago

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/

lupin3rd commented 7 years ago

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.