Tune OCR server's performance and RAM usage in a DLP-OCR integration
search cancel

Tune OCR server's performance and RAM usage in a DLP-OCR integration

book

Article ID: 217131

calendar_today

Updated On:

Products

Data Loss Prevention Sensitive Image Recognition Data Loss Prevention

Issue/Introduction

On an OCR server, it is expected for the RAM usage to fluctuate as it processes images. RAM will be used up for image processing and then periodically released after a number of requests. If however you observe that the RAM utilization is remaining at very high levels over longer periods, you could consider the remediation steps below.

Resolution

If the RAM usage on an OCR server remains at very high levels before a worker restart, leaving a small amount of available RAM, there are a couple of ways to address this:

1) If possible, increase the available RAM to see whether that helps to avoid the situations where the available memory falls almost to zero before a worker restart. 

2) On the OCR server, locate the config file ocr.properties and reduce the following setting (default should be 1000):

NUMBER_OF_REQUESTS_BEFORE_WORKER_RESTART

Reduce the setting in gradual slow steps, not abruptly, as the result here could be that the decrease of the parameter may have a side effect on the OCR performance itself, while allowing the worker to restart more quickly and thus before the RAM usage actually reaches almost 0. 

3) In the same file, look for the setting server.tomcat.max-threads - should be set by default to 5. This parameter defines the maximum number of threads an OCR server will use to process parallel requests. The recommendation is to have this set to equal or less than the number of logical CPU cores available on the OCR server. That value can be reduced to decrease resource utilization (mainly CPU) but it will also hit the OCR performance. Again recommended to reduce the setting gradually and then monitor the server's behavior.