<?xml version="1.0"?>
<oembed><version>1.0</version><provider_name>Aeologic Blog</provider_name><provider_url>https://www.aeologic.com/blog</provider_url><title>Solr Circuit Breakers : Configuration, Use Cases and Best Practices</title><type>rich</type><width>600</width><height>338</height><html>&lt;blockquote class="wp-embedded-content" data-secret="3nvmmEWBGG"&gt;&lt;a href="https://www.aeologic.com/blog/circuit-breakers-ultimate-solr-guide/"&gt;Circuit Breakers &#x2013; Ultimate Solr Guide&lt;/a&gt;&lt;/blockquote&gt;&lt;iframe sandbox="allow-scripts" security="restricted" src="https://www.aeologic.com/blog/circuit-breakers-ultimate-solr-guide/embed/#?secret=3nvmmEWBGG" width="600" height="338" title="&#x201C;Circuit Breakers &#x2013; Ultimate Solr Guide&#x201D; &#x2014; Aeologic Blog" data-secret="3nvmmEWBGG" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"&gt;&lt;/iframe&gt;&lt;script&gt;
/*! This file is auto-generated */
!function(d,l){"use strict";l.querySelector&amp;&amp;d.addEventListener&amp;&amp;"undefined"!=typeof URL&amp;&amp;(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&amp;&amp;!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i&lt;o.length;i++)o[i].style.display="none";for(i=0;i&lt;a.length;i++)s=a[i],e.source===s.contentWindow&amp;&amp;(s.removeAttribute("style"),"height"===t.message?(1e3&lt;(r=parseInt(t.value,10))?r=1e3:~~r&lt;200&amp;&amp;(r=200),s.height=r):"link"===t.message&amp;&amp;(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&amp;&amp;n.host===r.host&amp;&amp;l.activeElement===s&amp;&amp;(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r&lt;s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);
//# sourceURL=https://www.aeologic.com/blog/wp-includes/js/wp-embed.min.js
&lt;/script&gt;
</html><thumbnail_url>https://www.aeologic.com/blog/wp-content/uploads/2021/05/Circuit-Breakers-in-Solr.png</thumbnail_url><thumbnail_width>1800</thumbnail_width><thumbnail_height>1037</thumbnail_height><description>As modern search applications scale, maintaining system stability under heavy query loads becomes a critical challenge. Solr Circuit Breaker Configuration plays a vital role in ensuring that Apache Solr nodes do not get overwhelmed by excessive traffic, memory pressure, or CPU spikes. By intelligently rejecting requests during high resource utilization, circuit breakers help preserve system performance, prevent node crashes, and maintain a consistent user experience. This approach allows organizations to prioritize reliability over raw throughput, making it an essential strategy for enterprise-grade Solr deployments. When To Use Circuit Breakers Circuit breakers should be used when the user wishes to trade request throughput for a higher Solr stability. If circuit breakers are enabled, requests may be rejected under the condition of high node duress with an appropriate HTTP error code (typically 503). It is up to the client to handle this error and potentially build a retrial logic as this should ideally be a transient situation. What&#x2019;s New in Solr 9.x Circuit Breakers? With the release of Apache Solr 9.x, circuit breaker capabilities have become more robust, configurable, and production-ready. While earlier versions provided basic protection mechanisms, Solr 9.x enhances stability by offering better integration with modern infrastructure environments and improved monitoring capabilities. One of the most significant improvements is the refinement of JVM heap and CPU-based circuit breakers, making them more responsive to real-time node stress. Solr 9.x ensures that nodes under pressure can gracefully reject requests rather than degrade performance or crash entirely. Additionally, Solr 9.x aligns better with cloud-native deployments, allowing circuit breakers to work efficiently in containerized environments like Docker and orchestration platforms such as Kubernetes. These enhancements make circuit breakers not just a safety feature, but a core reliability mechanism for enterprise-grade Solr deployments. Circuit Breaker Configurations All circuit breaker configurations are listed in the circuitBreaker tags in solrconfig.xml as shown below: &lt;circuitBreaker class="solr.CircuitBreakerManager" enabled="true"&gt; &lt;!-- All specific configs in this section --&gt; &lt;/circuitBreaker&gt; The &#x201C;enabled&#x201D; attribute controls the global activation/deactivation of circuit breakers. If this flag is disabled, all circuit breakers will be disabled globally. Per circuit breaker configurations are specified in their respective sections later. This attribute acts as the highest authority and global controller of circuit breakers. For using specific circuit breakers, each one needs to be individually enabled in addition to this flag being enabled. CircuitBreakerManager is the default manager for all circuit breakers that should be defined in the tag unless the user wishes to use a custom implementation. Detailed Circuit Breaker Configuration Examples Configuring circuit breakers correctly is essential to achieving the right balance between performance and stability. Below is a more comprehensive configuration example: &lt;circuitBreaker class=&#x201C;solr.CircuitBreakerManager&#x201D; enabled=&#x201C;true&#x201D;&gt; &lt;!&#x2013; JVM Memory Circuit Breaker &#x2013;&gt; &lt;str name=&#x201C;memEnabled&#x201D;&gt;true&lt;/str&gt; &lt;str name=&#x201C;memThreshold&#x201D;&gt;75&lt;/str&gt;&lt;!&#x2013; CPU Circuit Breaker &#x2013;&gt; &lt;str name=&#x201C;cpuEnabled&#x201D;&gt;true&lt;/str&gt; &lt;str name=&#x201C;cpuThreshold&#x201D;&gt;80&lt;/str&gt; &lt;/circuitBreaker&gt;&nbsp; Currently Supported Circuit Breakers JVM Heap Usage-Based Circuit Breaker This circuit breaker tracks JVM heap memory usage and rejects incoming search requests with a 503 error code if the heap usage exceeds a configured percentage of maximum heap allocated to the JVM (-Xmx). The main configuration for this circuit breaker is controlling the threshold percentage at which the breaker will trip. Configuration for JVM heap usage-based circuit breaker: &lt;str name="memEnabled"&gt;true&lt;/str&gt; Note that this configuration will be overridden by the global circuit breaker flag&#x2009;&#x2014;&#x2009;if circuit breakers are disabled, this flag will not help you. The triggering threshold is defined as a percentage of the max heap allocated to the JVM. It is controlled by the below configuration: &lt;str name="memThreshold"&gt;75&lt;/str&gt; It does not logically make sense to have a threshold below 50% and above 95% of the max heap allocated to the JVM. Hence, the range of valid values for this parameter is [50, 95], both inclusive. Consider the following example: JVM has been allocated a maximum heap of 5GB (-Xmx) and memoryCircuitBreakerThresholdPct is set to 75. In this scenario, the heap usage at which the circuit breaker will trip is 3.75GB. CPU Utilization Based Circuit Breaker This circuit breaker tracks CPU utilization and triggers if the average CPU utilization over the last one minute exceeds a configurable threshold. Note that the value used in the computation is over the last one minute&#x2009;&#x2014;&#x2009;so a sudden spike in traffic that goes down might still cause the circuit breaker to trigger for a short while before it resolves and updates the value. Configuration for CPU utilization based circuit breaker: &lt;str name="cpuEnabled"&gt;true&lt;/str&gt; Note that this configuration will be overridden by the global circuit breaker flag&#x2009;&#x2014;&#x2009;if circuit breakers are disabled, this flag will not help you. The triggering threshold is defined in units of CPU utilization. The configuration to control this is as below: &lt;str name="cpuThreshold"&gt;75&lt;/str&gt; Circuit Breakers in Docker &amp; Cloud Environments Modern Solr deployments are increasingly containerized. Running Solr inside Docker introduces new challenges because resource limits are enforced at the container level, not the host. Key Challenge If your container has: 4GB RAM limit JVM heap set to 3GB A 75% threshold means: Circuit breaker trips at 2.25GB, not host memory. In SolrCloud Deployments Circuit breakers operate per node, not cluster-wide. This means: One overloaded node can reject requests Others continue serving traffic Combine with: Load balancers Smart routing strategies Real-World Use Cases of Solr Circuit Breakers Circuit breakers are not just theoretical safeguards&#x2014;they play a crucial role in real-world production environments where unpredictable traffic spikes and resource constraints are common. eCommerce Platforms During high-traffic events like: Flash sales Festive offers Product launches Search traffic can spike dramatically. Without proper Solr Circuit Breaker Configuration, nodes may become overwhelmed, leading to slow responses or complete outages. Circuit breakers ensure: Non-critical queries are rejected Core search functionality remains available System stability is maintained under peak load Performance Considerations It is worth noting that while JVM or CPU circuit breakers do not add any noticeable overhead per query, having too many circuit breakers checked for a single request can cause a performance overhead. In addition, it is a good practice to exponentially back off while retrying requests on a busy node. Conclusion Solr&#x2019;s circuit breaker infrastructure is a [&hellip;]</description></oembed>
