On 12/11/2021 8:39 AM, Scott wrote:
Thanks Shawn. Most people I talked to sort of acknowledged that restarting SOLR 
every month or so is a given, but your comments are encouraging.

These nodes have 32Gb of ram:

real memory  = 34359738368 (32768 MB)
avail memory = 33370628096 (31824 MB)

and here's what I have in my solr config

SOLR_JAVA_MEM="-Xms14512m -Xmx16512m"

I have noticed with Linux servers under my care that they do utilize more swap than I would have ever expected. But most of them seem to be healthy despite that.

If your machines are running Linux, then the following will apply. For other UNIX-like operating systems, I have no idea whether you can use this info:

---
This shell script will show you what programs are utilizing swap. It must be run as root:

https://apaste.info/Gnwx

It's not actually important whether there is swap in use. What's really important is whether or not the system is ACTIVELY swapping. You can see that with the following command, which I recommend running with a terminal width well beyond 80:

vmstat 2 -w

If the si and so columns frequently show numbers other than 0, then there is active swapping going on. If it is almost always 0 or a very small number, then there is probably no need to worry about swap usage.
---

With the "top" utility on most UNIX-like operating systems, there is a way we can see the overall health of memory usage on a system. If my email program clobbers this link, I apologize:

https://cwiki.apache.org/confluence/display/solr/SolrPerformanceProblems#SolrPerformanceProblems-Askingforhelponamemory/performanceissue

I thought I'd keep it at half of available RAM but it still goes into swap...

I really want to smack the person who came up with the rule of thumb where a Java heap gets assigned to be some fraction of the total memory size, usually between 25 and 50 percent. In practice, that advice usually means that the heap will be too small or significantly larger than it needs to be.

What you should do for the heap size is figure out how much heap memory the program actually needs to do its work, then assign the max heap to a number above that which gives the program some headroom to operate in. I do not have any generic guidelines for how much headroom is needed ... it will depend on the exact situation you find yourself in.

We also recommend setting the min heap and max heap to the same number. For your system that would mean this (instead of SOLR_JAVA_MEM):

SOLR_HEAP="16g"

Thanks,
Shawn

Reply via email to