When I upgraded from 3.2 to 3.6, I found that an optimize - all other variables 
being the same - took about twice as long. Eventually I was able to track this 
down to the new default of MMapDirectory. By changing back to NIOFSDirectory, I 
was able to get the optimize time back down to what it formerly was. I did this 
by adding this to solrconfig.xml:
<directoryFactory name="DirectoryFactory" class="solr.NIOFSDirectoryFactory"/>

I'd suggest trying that to see what effect it has (for us, NIOFSDirectory 
generally performs better across the board, but I've heard just the opposite 
from other people on this mailing list).

If that doesn't improve it, try looking at these things:
1) Is the size of the index files the same size as in 1.4? Perhaps something 
has changed to cause a significant size increase.
2) Is Solr 4 spending more time garbage collecting? Enable gc logging with 
-verbose:gc (or whatever the flag is), or use the jstat utility.
3) Watch the files in the index directory during the optimize and see if they 
are being written more slowly, or if the segment files are being "copied" 
around more often than before.

-Michael

-----Original Message-----
From: Sandeep Mestry [mailto:sanmes...@gmail.com] 
Sent: Tuesday, December 04, 2012 6:29 PM
To: solr-user@lucene.apache.org
Subject: Solr 4 : Optimize very slow

Hi All,

I have recently migrated from solr 1.4 to solr 4 and have done the basic
changes required for solr 4 in solrconfig.xml and schema.xml. I have also
rebuilt the index set for solr 4.
We run optimize every morning at 4 am and we keep the index updates off
during this process.
Previously, with 1.4 - the optimization used to take around 20-30 mins per
shard but now with solr 4, its taking 6-8 hours or even more..
I have also tested the optimize from solr UI and that takes 6-8 hours too..
The hardware is saeme and, we have deployed solr under WAS.
There ar 4 shards and every shard contains around 8 - 9 Gig of data and we
are using master-slave configuration with rsync. I have not enabled soft
commit. Also, commiter process is scheduled to run every minute.

I am not sure which part I'm missing, do let me know your inputs please.

Many Thanks in advance,
Sandeep

Reply via email to