11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

log4j.appender.file.MaxFileSize=100MB<br />

Logging Slow Queries<br />

For high-volume search applications, logging every query can generate a large amount of logs and, depending<br />

on the volume, potentially impact performance. If you mine these logs for additional insights into your application,<br />

then logging every query request may be useful. On the other hand, if you're only concerned about warnings and<br />

error messages related to requests, then you can set the log verbosity to WARN. However, this poses a potential<br />

problem in that you won't know if any queries are slow, as slow queries are still logged at the INFO level. <strong>Solr</strong><br />

provides a way to set your log verbosity threshold to WARN and be able to set a latency threshold above which a<br />

request is considered "slow" and log that request at the WARN level to help you identify slow queries in your<br />

application. To enable this behavior, configure the element in the query secti<br />

on of solrconfig.xml:<br />

1000<br />

Any queries that take longer than the specified threshold will be logged as "slow" queries at the WARN level.<br />

Using JMX with <strong>Solr</strong><br />

Java Management Extensions (JMX) is a technology that makes it possible for complex systems to be controlled<br />

by tools without the systems and tools having any previous knowledge of each other. In essence, it is a standard<br />

interface by which complex systems can be viewed and manipulated.<br />

<strong>Solr</strong>, like any other good citizen of the Java universe, can be controlled via a JMX interface. You can enable JMX<br />

support by adding lines to solrconfig.xml. You can use a JMX client, like jconsole, to connect with <strong>Solr</strong>.<br />

Check out the Wiki page http://wiki.apache.org/solr/<strong>Solr</strong>Jmx for more information. You may also find the following<br />

overview of JMX to be useful: http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html.<br />

Configuring JMX<br />

JMX configuration is provided in solrconfig.xml. Please see the JMX Technology Home Page for more<br />

details.<br />

A rootName attribute can be used when configuring in solrconfig.xml. If this attribute is set, <strong>Solr</strong><br />

uses it as the root name for all the MBeans that <strong>Solr</strong> exposes via JMX. The default name is "solr" followed by the<br />

core name.<br />

Enabling/disabling JMX and securing access to MBeanServers is left up to the user by specifying<br />

appropriate JVM parameters and configuration. Please explore the JMX Technology Home Page for<br />

more details.<br />

Configuring an Existing MBeanServer<br />

The command:<br />

<br />

enables JMX support in <strong>Solr</strong> if and only if an existing MBeanServer is found. Use this if you want to configure<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

541

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!