Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOLR 6.2 ignores heap settings (SOLR_JAVA_MEM param)

I've followed instructions from here and here to increase my SOLR memory allocation. I've done this because the SOLR server has shutdown periodically during some high frequency and high volume indexing activity.

I'm a little new to using SOLR and Ubuntu so bear with me, but I've found several locations where the SOLR_JAV_MEM parameter exist:

/opt/solr-6.2.0/bin/solr.in.sh
/opt/solr-6.2.0/bin/solr.in.cmd
/opt/solr-6.2.0/bin/solr.cmd
The same set of files in this directory: /home/deploy/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/sunspot_solr-2.2.5/solr/bin
And this directory: 
/home/deploy/solr-6.2.0/bin 
And finally, in this file: /etc/default/solr.in.sh

Anywhere I've seen a SOLR_JAV_MEM or SOLR_HEAP param with a number, I've replaced it with a larger value, for example in /opt/solr-6.2.0/bin/solr.in.sh:

# Increase Java Heap as needed to support your indexing / query needs
SOLR_HEAP="1500m"

# Expert: If you want finer control over memory options, specify them directly
# Comment out SOLR_HEAP if you are using this though, that takes precedence
#SOLR_JAVA_MEM="-Xms1512m -Xmx1512m"

If I'm measuring it correctly, I still only see about 500MB of memory allocated to SOLR, as seen by the following command:

root@ip-xxx:~# service solr status

Found 1 Solr nodes:

Solr process 15259 running on port 8989
{
  "solr_home":"/var/solr/data",
  "version":"6.2.0 764d0f19151dbff6f5fcd9fc4b2682cf934590c5 - mike - 2016-08-20 05:41:37",
  "startTime":"2016-09-28T15:01:18.001Z",
  "uptime":"0 days, 0 hours, 12 minutes, 28 seconds",
  "memory":"100 MB (%20.4) of 490.7 MB"}

Am I doing something wrong? Or am I just measuring the memory incorrectly? Please let me know if I can provide add'l info. Thanks!

like image 540
Kristoph Matthews Avatar asked Sep 28 '16 15:09

Kristoph Matthews


1 Answers

I'll answer my own question. It turned out that I had to edit the /etc/default/solr.in.sh file. I changed the SOLR_HEAP="512M" to SOLR_HEAP="1500m" and ran sudo service solr status and saw the memory showing 1.5G!

like image 99
Kristoph Matthews Avatar answered Sep 16 '22 18:09

Kristoph Matthews