We had some serious slowness at startup before I set Xms to be the same as Xmx.

We run with an 8G heap. We have multiple collections but don’t use faceting.

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Nov 28, 2016, at 8:40 AM, Max Bridgewater <max.bridgewa...@gmail.com> 
> wrote:
> 
> Thanks again Folks. I tried each suggestion and none made any difference. I
> am setting up a lab for performance monitoring using App Dynamics.
> Hopefully I am able to figure out something.
> 
> On Mon, Nov 28, 2016 at 11:20 AM, Erick Erickson <erickerick...@gmail.com>
> wrote:
> 
>> bq: If you know the maximum size you ever will need, setting Xmx is good.
>> 
>> Not quite sure what you're getting at here. I pretty much guarantee that a
>> production system will eat up the default heap size, so not setting Xmx
>> will
>> cause OOM errors pretty soon. Or did you mean Xms?
>> 
>> As far as setting Xms, there are differing opinions, mostly though since
>> Solr
>> likes memory so much there's a lot of tuning to try to determine Xmx and
>> it's pretty much guaranteed that Java will need close to that amount of
>> memory.
>> So setting Xms=Xmx is a minor optimization if that assumption is true.
>> It's arguable
>> how much practical difference it makes though.
>> 
>> Best,
>> Erick
>> 
>> On Mon, Nov 28, 2016 at 2:14 AM, Florian Gleixner <f...@redflo.de> wrote:
>>> Am 28.11.2016 um 00:00 schrieb Shawn Heisey:
>>>> 
>>>> On 11/27/2016 12:51 PM, Florian Gleixner wrote:
>>>>> 
>>>>> On 22.11.2016 14:54, Max Bridgewater wrote:
>>>>>> 
>>>>>> test cases were exactly the same, the machines where exactly the same
>>>>>> and heap settings exactly the same (Xms24g, Xmx24g). Requests were
>>>>>> sent with
>>>>> 
>>>>> Setting heap too large is a common error. Recent Solr use the
>>>>> filesystem cache, so you don't have to set heap to the size of the
>>>>> index. The avalible RAM has to be able to run the OS, run the jvm and
>>>>> hold most of the index data in filesystem cache. If you have 32GB RAM
>>>>> and a 20GB Index, then set -Xms never higher than 10GB. I personally
>>>>> would set -Xms to 4GB and omit -Xmx
>>>> 
>>>> 
>>>> In my mind, the Xmx setting is much more important than Xms.  Setting
>>>> both to the same number avoids any need for Java to detect memory
>>>> pressure before increasing the heap size, which can be helpful.
>>>> 
>>> 
>>> From https://cwiki.apache.org/confluence/display/solr/JVM+Settings
>>> 
>>> "The maximum heap size, set with -Xmx, is more critical. If the memory
>> heap
>>> grows to this size, object creation may begin to fail and throw
>>> OutOfMemoryException. Setting this limit too low can cause spurious
>> errors
>>> in your application, but setting it too high can be detrimental as well."
>>> 
>>> you are right, Xmx is more important. But setting Xms to Xmx will waste
>> RAM,
>>> that the OS can use to cache your index data. Setting Xmx can avoid
>> problems
>>> in some situations where solr can eat up your filesystem cache until the
>>> next GC has been finished.
>>> 
>>>> Without Xmx, Java is in control of the max heap size, and it may not
>>>> make the correct choice.  It's important to know what your max heap is,
>>>> because chances are excellent that the max heap *will* be reached.  Solr
>>>> allocates a lot of memory to do its job.
>>>> 
>>> 
>>> If you know the maximum size you ever will need, setting Xmx is good.
>>> 
>>> 
>>> 
>>> 
>> 

Reply via email to