TECH: Resolving solr slowness on Linux

pencils

Overview

Performance degrades as your solr usage increases.

Search queries are returning painfully slow. After extensive debugging, the issue continues to plague your organization. Your boss is breathing over your shoulder. You haven’t slept in a day.

You may be out of memory!

Try running top(1) to gauge your current java/solr usage.

Next, check your solr startup script (in our case: /etc/init.d/solr) .

The -Xmx option specifies memory limits for the process:

SOLR_OPTS="-Djava.util.logging.config.file=/usr/local/arizona/appgravity-solr-logging.properties -Xmx1024m -DSTOP.PORT=8079 -DSTOP.KEY=
stopkey -Dsolr.solr.home=appgravity-solr -jar start.jar"

Change that to a higher value:

SOLR_OPTS="-Djava.util.logging.config.file=/usr/local/arizona/appgravity-solr-logging.properties -Xmx4096m -DSTOP.PORT=8079 -DSTOP.KEY=
stopkey -Dsolr.solr.home=appgravity-solr -jar start.jar"

Restart solr and run top(1) again. Is the process using more memory? Do your queries return faster?

Leave a Reply

Your email address will not be published. Required fields are marked *