Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr optimize command status

Tags:

solr

I have run the solr optimize command using update?optimize=true. Can any one pls tel me how to check the status of Solr optimize command? I am using Solr 3.5 Thanks in advance.

like image 692
myQuest5 Avatar asked Jan 17 '23 07:01

myQuest5


2 Answers

While the optimize is running, you can run the top command, type M to sort by memory usage, and watch the RES and SHR columns increase for the SOLR java process. Also keep and eye on Mem: free at the top of the screen. As long as RES and SHR are increasing, optimize is working. In fact the only thing that will stop it would be if Mem: free goes down to zero.

If that happens to you, rerun optimize with a LARGER number for maxSegments. For instance if 5 segments runs out of RAM, try 9. Then run again with 8, then again with 7, then try 5 again, and 3 and 1.

like image 108
Michael Dillon Avatar answered Mar 11 '23 15:03

Michael Dillon


The easiest way to check the status of the index after an optimize, is to browse to http://<your instance & core>/admin/stats.jsp. This is also the same as clicking [Statistics] link off of the Solr Admin page.

If you look in the stats: section once on that page, typically after an optimize, the numDocs and maxDoc values will be the same as all pending deletes will have occurred. Also the reader value should show a value that contains segments=1 at the end. This will be the case as the optimize command will force the index to be merged into one section as explained below in this excerpt from the UpdateXmlMessages section for optimize in the Solr Wiki.

An optimize is like a hard commit except that it forces all of the index segments to be merged into a single segment first.

like image 41
Paige Cook Avatar answered Mar 11 '23 14:03

Paige Cook