You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Tomas <to...@yahoo.com.ar> on 2010/04/20 00:10:40 UTC

SOLR-571:LRUCache autowarmCount should support percentages

Hi, I've been using Solr for some time and i would like to contribute a little. I found on Jira an improvement that seems to be easy to implement (I don't want to go with the most difficult ones until I get completly familiar with Solr code), the one on the Subject of this mail: SOLR-571:LRUCache autowarmCount should support percentages.

I was thinking in modify both, the FastLRUCache and the LRUCache to allow percentages (as well as absolute values of course) on "autowarmCount" parameter, and in the case of a percentage, simply evaluate it on the "init" method.

For example, when "size" parameter is 1000 and "autowarmCount" parameter is "50%", simply set the field autowarmCount in 500. 
Does someone see a potential problem here? 

Tomás



      

Re: SOLR-571:LRUCache autowarmCount should support percentages

Posted by Tomas <to...@yahoo.com.ar>.
You are right Chris, what I need on warming would be the last accessed 50% (in this example) of the items on the old cache. That sould be evaluated on the "warm" method.


Tomás



________________________________
De: Chris Hostetter <ho...@fucit.org>
Para: dev@lucene.apache.org
Enviado: martes, 20 de abril, 2010 2:25:19
Asunto: Re: SOLR-571:LRUCache autowarmCount should support percentages


: what is the meaning of 50%? 50% of all queries fired since the last
: searcher opened? sounds like a bad idea.

the motivation behind it is stated in the issue....

>> the autowarmCount for LRUCaches should support "percentages" which get 
>> evaluated relative the current size of the cache when warming happens.

>> in this way, a Solr instance might be configured with 
>> autowarmCount="50%" to autowarm the top half of the queries ... a 
>> master machine might be configured this way to give some autowarming if 
>> it is inadvertently being queried, but things won't be maintained in 
>> the caches in perpetuity ... each subsequent cache instance would have 
>> fewer and fewer of the "old" queries warmed automatically.

...why would that be bad?

: > I was thinking in modify both, the FastLRUCache and the LRUCache to allow
: > percentages (as well as absolute values of course) on "autowarmCount"
: > parameter, and in the case of a percentage, simply evaluate it on the "init"
: > method.

The percentage string can be parsed on init, but to be useful the actual 
computation against the "size" needs to be done on each autowarm call so 
that if it's 50% it's warms half the the size of hte cache at the time 
it's warmed -- if you compute what 50% of the size is during init, then it 
defeats the point.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


      

Re: SOLR-571:LRUCache autowarmCount should support percentages

Posted by Chris Hostetter <ho...@fucit.org>.
: what is the meaning of 50%? 50% of all queries fired since the last
: searcher opened? sounds like a bad idea.

the motivation behind it is stated in the issue....

>> the autowarmCount for LRUCaches should support "percentages" which get 
>> evaluated relative the current size of the cache when warming happens.

>> in this way, a Solr instance might be configured with 
>> autowarmCount="50%" to autowarm the top half of the queries ... a 
>> master machine might be configured this way to give some autowarming if 
>> it is inadvertently being queried, but things won't be maintained in 
>> the caches in perpetuity ... each subsequent cache instance would have 
>> fewer and fewer of the "old" queries warmed automatically.

...why would that be bad?

: > I was thinking in modify both, the FastLRUCache and the LRUCache to allow
: > percentages (as well as absolute values of course) on "autowarmCount"
: > parameter, and in the case of a percentage, simply evaluate it on the "init"
: > method.

The percentage string can be parsed on init, but to be useful the actual 
computation against the "size" needs to be done on each autowarm call so 
that if it's 50% it's warms half the the size of hte cache at the time 
it's warmed -- if you compute what 50% of the size is during init, then it 
defeats the point.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: SOLR-571:LRUCache autowarmCount should support percentages

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
what is the meaning of 50%? 50% of all queries fired since the last
searcher opened? sounds like a bad idea.

On Tue, Apr 20, 2010 at 3:40 AM, Tomas <to...@yahoo.com.ar> wrote:
> Hi, I've been using Solr for some time and i would like to contribute a
> little. I found on Jira an improvement that seems to be easy to implement (I
> don't want to go with the most difficult ones until I get completly familiar
> with Solr code), the one on the Subject of this mail: SOLR-571:LRUCache
> autowarmCount should support percentages.
>
> I was thinking in modify both, the FastLRUCache and the LRUCache to allow
> percentages (as well as absolute values of course) on "autowarmCount"
> parameter, and in the case of a percentage, simply evaluate it on the "init"
> method.
>
> For example, when "size" parameter is 1000 and "autowarmCount" parameter is
> "50%", simply set the field autowarmCount in 500.
> Does someone see a potential problem here?
>
> Tomás
>
>



-- 
-----------------------------------------------------
Noble Paul | Systems Architect| AOL | http://aol.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org