The indices.breaker.request.limit
setting in Elasticsearch is part of the circuit breaker framework. It controls the maximum amount of memory that can be allocated for a single request. This setting helps prevent out-of-memory errors by limiting the resources consumed by large, potentially problematic requests.
- Default value: 60% of JVM heap
- Possible values: Any percentage (e.g., 40%) or absolute byte size (e.g., 10GB)
- Recommendations: The default value is suitable for most use cases. Adjust only if you're experiencing frequent request circuit breaker errors or have specific workload requirements.
This setting is crucial for maintaining cluster stability by preventing individual requests from consuming excessive memory. It's particularly important for clusters that handle varied query sizes or complex aggregations.
Example
To change the indices.breaker.request.limit
to 40% of the JVM heap:
indices.breaker.request.limit: 40%
You might want to lower this value if you're experiencing out-of-memory errors due to large requests. Conversely, you might increase it if you have a lot of available memory and need to support more complex queries.
Changing this setting will affect the maximum memory allocation for individual requests. A lower value provides more protection against memory issues but may limit the complexity of queries that can be executed.
Common Issues and Misuses
- Setting the limit too low can cause frequent circuit breaker errors, impacting legitimate queries.
- Setting the limit too high can lead to out-of-memory errors if large requests consume too much of the available heap.
- Misunderstanding the relationship between this setting and other circuit breakers, potentially leading to conflicts.
Do's and Don'ts
Do's:
- Monitor circuit breaker events and adjust the limit based on your cluster's performance and requirements.
- Consider the nature of your queries and data when setting this value.
- Use percentage values for more flexible configuration across different environments.
Don'ts:
- Don't set the limit too high without considering the impact on overall cluster stability.
- Avoid frequent changes to this setting without monitoring the effects.
- Don't ignore other circuit breaker settings when adjusting this one, as they work together.
Frequently Asked Questions
Q: How does indices.breaker.request.limit differ from other circuit breaker settings?
A: While other circuit breakers like fielddata or total limit overall memory usage for specific operations or the entire node, indices.breaker.request.limit specifically targets individual request memory allocation.
Q: Can changing this setting improve query performance?
A: Not directly. This setting is primarily for preventing out-of-memory errors. However, by allowing larger requests, it may enable more complex queries to complete successfully.
Q: What happens if a request exceeds the limit?
A: Elasticsearch will throw a circuit breaker exception, preventing the request from consuming more memory and potentially crashing the node.
Q: How often should I adjust this setting?
A: Adjust only when necessary, based on monitoring circuit breaker events and overall cluster performance. It's not a setting that requires frequent tuning.
Q: Is this setting node-specific or cluster-wide?
A: This setting can be configured at both the node and cluster level. When set in elasticsearch.yml, it applies to that specific node. It can also be updated cluster-wide using the cluster settings API.