lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <s...@elyograg.org>
Subject Re: Stopping Solr instance
Date Tue, 08 Apr 2014 21:51:07 GMT
On 4/8/2014 1:28 PM, abhishek jain wrote:
> What is the best way to stop solr from command line, the command with the
> stop port and secret key as given in most online help links don't work for
> me all time,
>
> I have to kill it most times ! i have though noted excessive swap usage when
> i have to kill it. Is there a link between swap usage and solr not stopping?

My init script first tries the jetty port/key stop method that you 
mentioned, then tries to gracefully kill by PID and by Solr listening 
port.  If none of that works in a reasonable timeframe, it will do kill 
-9.  Here's my redhat-specific init script, which may require adaptation 
for others to use:

http://wiki.apache.org/solr/ShawnHeisey#Init_script

If the system is swapping, that will make everything extremely slow.  A 
graceful shutdown would likely take minutes instead of seconds, so a 
hard kill might be required.Swapping should be avoided at all costs.

Java programs (like Solr) have strict limits on how much memory they're 
allowed to consume.  If Solr is the only program on the machine, then 
swapping should only be possible if the Java heap is higher than (or 
very close to) the available RAM on the machine.

There is one possible situation where swapping can happen even when 
there is no memory pressure.  This happens when the machine has a NUMA 
architecture, two (or more) physical CPUs, and you are requesting a very 
large amount of RAM on the machine for your application:

http://blog.jcole.us/2010/09/28/mysql-swap-insanity-and-the-numa-architecture/

If you are running into this swap insanity problem, you may need to 
utilize numa tools to start Solr.  I will say that allocating more than 
half of the RAM in a machine to Solr is likely to be a bad choice, 
because that doesn't leave much for the OS disk cache.  The OS disk 
cache is a very important part of Solr performance.

Thanks,
Shawn


Mime
View raw message