You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by P Williams <wi...@gmail.com> on 2014/01/13 20:40:39 UTC

Changing Cache Properties after Indexing

Hi,

I've gone through steps for tuning my cache sizes and I'm very happy with
the results of load testing.  Unfortunately the cache settings for querying
are not optimal for indexing - and in fact slow it down quite a bit.

I've made the caches small by default for the indexing stage and then want
to override the values using properties when used for querying.  That's
easy enough to do and described in
SolrConfigXml<http://wiki.apache.org/solr/SolrConfigXml>
.

I store these properties in a solrcore-querying.properties file.  When
indexing is complete I could unload the Solr core, move (mv) this file to
conf/solrcore.properties and then load the Solr core and it would pick up
the new properties.  The only problem with that is in production I won't
have access to the machine to make changes to the file system.  I need to
be able to do this using the Core Admin API.

I can see that I can specify individual properties with the CREATE command,
for instance property.solr.filterCache.size=2003232.  Great!  So this is
possible but I still have two questions:

   1. Is there a way to specify a conf/solrcore-querying.properties file to
   the admin/cores handler instead of each property individually?
   2. The same functionality doesn't seem to be available when I call the
   RELOAD command.  Is this expected behaviour?  Should it be?

Is there a better way?

Thanks,
Tricia

Re: Changing Cache Properties after Indexing

Posted by Kranti Parisa <kr...@gmail.com>.
Doesn't it make sense to have a Indexer, Query Engine setup?

Indexer = Solr instance with replication configured as Master
Query Engine = One or more Solr instances with replication configured as
Slave

So that, you can do batch indexing on the Indexer, perform threshold checks
if needed by disabling the replication. If threshold checks are passed,
enable the replication.

This way you can configure the caches, other settings that you need for
indexing and configure something else on your Query Engine.

Thanks,
Kranti K. Parisa
http://www.linkedin.com/in/krantiparisa



On Fri, Jan 17, 2014 at 11:31 AM, P Williams <williams.tricia.list@gmail.com
> wrote:

> You're both completely right.  There isn't any issue with indexing with
> large cache settings.
>
> I ran the same indexing job five times, twice with large cache and twice
> with the default values. I threw out the first job because no matter if
> it's cached or uncached it runs ~2x slower. This must have been the
> observation I based my incorrect caching notion on.
>
> I unloaded with delete of the data directory and reloaded the core each
> time.  I'm using DIH with the FileEntityProcessor and
> PlainTextEnityProcessor to index ~11000 fulltext books.
>
> w/ cache
> 0:13:14.823
> 0:12:33.910
>
> w/o cache
> 0:12:13.186
> 0:15:56.566
>
> There is variation, but not anything that could be explained by the cache
> settings. Doh!
>
> Thanks,
> Tricia
>
>
> On Mon, Jan 13, 2014 at 6:08 PM, Shawn Heisey <so...@elyograg.org> wrote:
>
> > On 1/13/2014 4:44 PM, Erick Erickson wrote:
> >
> >> On the face of it, it's somewhat unusual to have the cache settings
> >> affect indexing performance. What are you seeing and how are you
> indexing?
> >>
> >
> > I think this is probably an indirect problem.  Cache settings don't
> > directly affect indexing speed, but when autoWarm values are high and NRT
> > indexing is happening, new searchers are requested frequently and the
> > autoWarm makes that happen slowly with a lot of resources consumed.
> >
> > Thanks,
> > Shawn
> >
> >
>

Re: Changing Cache Properties after Indexing

Posted by P Williams <wi...@gmail.com>.
You're both completely right.  There isn't any issue with indexing with
large cache settings.

I ran the same indexing job five times, twice with large cache and twice
with the default values. I threw out the first job because no matter if
it's cached or uncached it runs ~2x slower. This must have been the
observation I based my incorrect caching notion on.

I unloaded with delete of the data directory and reloaded the core each
time.  I'm using DIH with the FileEntityProcessor and
PlainTextEnityProcessor to index ~11000 fulltext books.

w/ cache
0:13:14.823
0:12:33.910

w/o cache
0:12:13.186
0:15:56.566

There is variation, but not anything that could be explained by the cache
settings. Doh!

Thanks,
Tricia


On Mon, Jan 13, 2014 at 6:08 PM, Shawn Heisey <so...@elyograg.org> wrote:

> On 1/13/2014 4:44 PM, Erick Erickson wrote:
>
>> On the face of it, it's somewhat unusual to have the cache settings
>> affect indexing performance. What are you seeing and how are you indexing?
>>
>
> I think this is probably an indirect problem.  Cache settings don't
> directly affect indexing speed, but when autoWarm values are high and NRT
> indexing is happening, new searchers are requested frequently and the
> autoWarm makes that happen slowly with a lot of resources consumed.
>
> Thanks,
> Shawn
>
>

Re: Changing Cache Properties after Indexing

Posted by Shawn Heisey <so...@elyograg.org>.
On 1/13/2014 4:44 PM, Erick Erickson wrote:
> On the face of it, it's somewhat unusual to have the cache settings
> affect indexing performance. What are you seeing and how are you indexing?

I think this is probably an indirect problem.  Cache settings don't 
directly affect indexing speed, but when autoWarm values are high and 
NRT indexing is happening, new searchers are requested frequently and 
the autoWarm makes that happen slowly with a lot of resources consumed.

Thanks,
Shawn


Re: Changing Cache Properties after Indexing

Posted by Erick Erickson <er...@gmail.com>.
On the face of it, it's somewhat unusual to have the cache settings
affect indexing performance. What are you seeing and how are you indexing?


Best,
Erick

On Mon, Jan 13, 2014 at 2:40 PM, P Williams
<wi...@gmail.com> wrote:
> Hi,
>
> I've gone through steps for tuning my cache sizes and I'm very happy with
> the results of load testing.  Unfortunately the cache settings for querying
> are not optimal for indexing - and in fact slow it down quite a bit.
>
> I've made the caches small by default for the indexing stage and then want
> to override the values using properties when used for querying.  That's
> easy enough to do and described in
> SolrConfigXml<http://wiki.apache.org/solr/SolrConfigXml>
> .
>
> I store these properties in a solrcore-querying.properties file.  When
> indexing is complete I could unload the Solr core, move (mv) this file to
> conf/solrcore.properties and then load the Solr core and it would pick up
> the new properties.  The only problem with that is in production I won't
> have access to the machine to make changes to the file system.  I need to
> be able to do this using the Core Admin API.
>
> I can see that I can specify individual properties with the CREATE command,
> for instance property.solr.filterCache.size=2003232.  Great!  So this is
> possible but I still have two questions:
>
>    1. Is there a way to specify a conf/solrcore-querying.properties file to
>    the admin/cores handler instead of each property individually?
>    2. The same functionality doesn't seem to be available when I call the
>    RELOAD command.  Is this expected behaviour?  Should it be?
>
> Is there a better way?
>
> Thanks,
> Tricia