fix-common-cluster-issues.asciidoc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. [[fix-common-cluster-issues]]
  2. == Fix common cluster issues
  3. This guide describes how to fix common errors and problems with {es} clusters.
  4. [discrete]
  5. === Error: disk usage exceeded flood-stage watermark, index has read-only-allow-delete block
  6. This error indicates a data node is critically low on disk space and has reached
  7. the <<cluster-routing-flood-stage,flood-stage disk usage watermark>>. To prevent
  8. a full disk, when a node reaches this watermark, {es} blocks writes to any index
  9. with a shard on the node. If the block affects related system indices, {kib} and
  10. other {stack} features may become unavailable.
  11. {es} will automatically remove the write block when the affected node's disk
  12. usage goes below the <<cluster-routing-watermark-high,high disk watermark>>. To
  13. achieve this, {es} automatically moves some of the affected node's shards to
  14. other nodes in the same data tier.
  15. To verify that shards are moving off the affected node, use the <<cat-shards,cat
  16. shards API>>.
  17. [source,console]
  18. ----
  19. GET _cat/shards?v=true
  20. ----
  21. If shards remain on the node, use the <<cluster-allocation-explain,cluster
  22. allocation explanation API>> to get an explanation for their allocation status.
  23. [source,console]
  24. ----
  25. GET _cluster/allocation/explain
  26. {
  27. "index": "my-index",
  28. "shard": 0,
  29. "primary": false,
  30. "current_node": "my-node"
  31. }
  32. ----
  33. // TEST[s/^/PUT my-index\n/]
  34. // TEST[s/"primary": false,/"primary": false/]
  35. // TEST[s/"current_node": "my-node"//]
  36. To immediately restore write operations, you can temporarily increase the disk
  37. watermarks and remove the write block.
  38. [source,console]
  39. ----
  40. PUT _cluster/settings
  41. {
  42. "persistent": {
  43. "cluster.routing.allocation.disk.watermark.low": "90%",
  44. "cluster.routing.allocation.disk.watermark.high": "95%",
  45. "cluster.routing.allocation.disk.watermark.flood_stage": "97%"
  46. }
  47. }
  48. PUT */_settings?expand_wildcards=all
  49. {
  50. "index.blocks.read_only_allow_delete": null
  51. }
  52. ----
  53. // TEST[s/^/PUT my-index\n/]
  54. As a long-term solution, we recommend you add nodes to the affected data tiers
  55. or upgrade existing nodes to increase disk space. To free up additional disk
  56. space, you can delete unneeded indices using the <<indices-delete-index,delete
  57. index API>>.
  58. [source,console]
  59. ----
  60. DELETE my-index
  61. ----
  62. // TEST[s/^/PUT my-index\n/]
  63. When a long-term solution is in place, reset or reconfigure the disk watermarks.
  64. [source,console]
  65. ----
  66. PUT _cluster/settings
  67. {
  68. "persistent": {
  69. "cluster.routing.allocation.disk.watermark.low": null,
  70. "cluster.routing.allocation.disk.watermark.high": null,
  71. "cluster.routing.allocation.disk.watermark.flood_stage": null
  72. }
  73. }
  74. ----
  75. [discrete]
  76. [[circuit-breaker-errors]]
  77. === Circuit breaker errors
  78. {es} uses <<circuit-breaker,circuit breakers>> to prevent nodes from running out
  79. of JVM heap memory. If Elasticsearch estimates an operation would exceed a
  80. circuit breaker, it stops the operation and returns an error.
  81. By default, the <<parent-circuit-breaker,parent circuit breaker>> triggers at
  82. 95% JVM memory usage. To prevent errors, we recommend taking steps to reduce
  83. memory pressure if usage consistently exceeds 85%.
  84. [discrete]
  85. [[diagnose-circuit-breaker-errors]]
  86. ==== Diagnose circuit breaker errors
  87. **Error messages**
  88. If a request triggers a circuit breaker, {es} returns an error with a `429` HTTP
  89. status code.
  90. [source,js]
  91. ----
  92. {
  93. 'error': {
  94. 'type': 'circuit_breaking_exception',
  95. 'reason': '[parent] Data too large, data for [<http_request>] would be [123848638/118.1mb], which is larger than the limit of [123273216/117.5mb], real usage: [120182112/114.6mb], new bytes reserved: [3666526/3.4mb]',
  96. 'bytes_wanted': 123848638,
  97. 'bytes_limit': 123273216,
  98. 'durability': 'TRANSIENT'
  99. },
  100. 'status': 429
  101. }
  102. ----
  103. // NOTCONSOLE
  104. {es} also writes circuit breaker errors to <<logging,`elasticsearch.log`>>. This
  105. is helpful when automated processes, such as allocation, trigger a circuit
  106. breaker.
  107. [source,txt]
  108. ----
  109. Caused by: org.elasticsearch.common.breaker.CircuitBreakingException: [parent] Data too large, data for [<transport_request>] would be [num/numGB], which is larger than the limit of [num/numGB], usages [request=0/0b, fielddata=num/numKB, in_flight_requests=num/numGB, accounting=num/numGB]
  110. ----
  111. **Check JVM memory usage**
  112. If you've enabled Stack Monitoring, you can view JVM memory usage in {kib}. In
  113. the main menu, click **Stack Monitoring**. On the Stack Monitoring **Overview**
  114. page, click **Nodes**. The **JVM Heap** column lists the current memory usage
  115. for each node.
  116. You can also use the <<cat-nodes,cat nodes API>> to get the current
  117. `heap.percent` for each node.
  118. [source,console]
  119. ----
  120. GET _cat/nodes?v=true&h=name,node*,heap*
  121. ----
  122. To get the JVM memory usage for each circuit breaker, use the
  123. <<cluster-nodes-stats,node stats API>>.
  124. [source,console]
  125. ----
  126. GET _nodes/stats/breaker
  127. ----
  128. [discrete]
  129. [[prevent-circuit-breaker-errors]]
  130. ==== Prevent circuit breaker errors
  131. **Reduce JVM memory pressure**
  132. High JVM memory pressure often causes circuit breaker errors. See
  133. <<high-jvm-memory-pressure>>.
  134. **Avoid using fielddata on `text` fields**
  135. For high-cardinality `text` fields, fielddata can use a large amount of JVM
  136. memory. To avoid this, {es} disables fielddata on `text` fields by default. If
  137. you've enabled fielddata and triggered the <<fielddata-circuit-breaker,fielddata
  138. circuit breaker>>, consider disabling it and using a `keyword` field instead.
  139. See <<fielddata>>.
  140. **Clear the fieldata cache**
  141. If you've triggered the fielddata circuit breaker and can't disable fielddata,
  142. use the <<indices-clearcache,clear cache API>> to clear the fielddata cache.
  143. This may disrupt any in-flight searches that use fielddata.
  144. [source,console]
  145. ----
  146. POST _cache/clear?fielddata=true
  147. ----
  148. // TEST[s/^/PUT my-index\n/]
  149. [discrete]
  150. [[high-cpu-usage]]
  151. === High CPU usage
  152. {es} uses <<modules-threadpool,thread pools>> to manage CPU resources for
  153. concurrent operations. High CPU usage typically means one or more thread pools
  154. are running low.
  155. If a thread pool is depleted, {es} will <<rejected-requests,reject requests>>
  156. related to the thread pool. For example, if the `search` thread pool is
  157. depleted, {es} will reject search requests until more threads are available.
  158. [discrete]
  159. [[diagnose-high-cpu-usage]]
  160. ==== Diagnose high CPU usage
  161. **Check CPU usage**
  162. include::{es-repo-dir}/tab-widgets/cpu-usage-widget.asciidoc[]
  163. **Check hot threads**
  164. If a node has high CPU usage, use the <<cluster-nodes-hot-threads,nodes hot
  165. threads API>> to check for resource-intensive threads running on the node.
  166. [source,console]
  167. ----
  168. GET _nodes/my-node,my-other-node/hot_threads
  169. ----
  170. // TEST[s/\/my-node,my-other-node//]
  171. This API returns a breakdown of any hot threads in plain text.
  172. [discrete]
  173. [[reduce-cpu-usage]]
  174. ==== Reduce CPU usage
  175. The following tips outline the most common causes of high CPU usage and their
  176. solutions.
  177. **Scale your cluster**
  178. Heavy indexing and search loads can deplete smaller thread pools. To better
  179. handle heavy workloads, add more nodes to your cluster or upgrade your existing
  180. nodes to increase capacity.
  181. **Spread out bulk requests**
  182. While more efficient than individual requests, large <<docs-bulk,bulk indexing>>
  183. or <<search-multi-search,multi-search>> requests still require CPU resources. If
  184. possible, submit smaller requests and allow more time between them.
  185. **Cancel long-running searches**
  186. Long-running searches can block threads in the `search` thread pool. To check
  187. for these searches, use the <<tasks,task management API>>.
  188. [source,console]
  189. ----
  190. GET _tasks?actions=*search&detailed
  191. ----
  192. The response's `description` contains the search request and its queries.
  193. `running_time_in_nanos` shows how long the search has been running.
  194. [source,console-result]
  195. ----
  196. {
  197. "nodes" : {
  198. "oTUltX4IQMOUUVeiohTt8A" : {
  199. "name" : "my-node",
  200. "transport_address" : "127.0.0.1:9300",
  201. "host" : "127.0.0.1",
  202. "ip" : "127.0.0.1:9300",
  203. "tasks" : {
  204. "oTUltX4IQMOUUVeiohTt8A:464" : {
  205. "node" : "oTUltX4IQMOUUVeiohTt8A",
  206. "id" : 464,
  207. "type" : "transport",
  208. "action" : "indices:data/read/search",
  209. "description" : "indices[my-index], search_type[QUERY_THEN_FETCH], source[{\"query\":...}]",
  210. "start_time_in_millis" : 4081771730000,
  211. "running_time_in_nanos" : 13991383,
  212. "cancellable" : true
  213. }
  214. }
  215. }
  216. }
  217. }
  218. ----
  219. // TESTRESPONSE[skip: no way to get tasks]
  220. To cancel a search and free up resources, use the API's `_cancel` endpoint.
  221. [source,console]
  222. ----
  223. POST _tasks/oTUltX4IQMOUUVeiohTt8A:464/_cancel
  224. ----
  225. For additional tips on how to track and avoid resource-intensive searches, see
  226. <<avoid-expensive-searches,Avoid expensive searches>>.
  227. [discrete]
  228. [[high-jvm-memory-pressure]]
  229. === High JVM memory pressure
  230. High JVM memory usage can degrade cluster performance and trigger
  231. <<circuit-breaker-errors,circuit breaker errors>>. To prevent this, we recommend
  232. taking steps to reduce memory pressure if a node's JVM memory usage consistently
  233. exceeds 85%.
  234. [discrete]
  235. [[diagnose-high-jvm-memory-pressure]]
  236. ==== Diagnose high JVM memory pressure
  237. **Check JVM memory pressure**
  238. include::{es-repo-dir}/tab-widgets/code.asciidoc[]
  239. include::{es-repo-dir}/tab-widgets/jvm-memory-pressure-widget.asciidoc[]
  240. **Check garbage collection logs**
  241. As memory usage increases, garbage collection becomes more frequent and takes
  242. longer. You can track the frequency and length of garbage collection events in
  243. <<logging,`elasticsearch.log`>>. For example, the following event states {es}
  244. spent more than 50% (21 seconds) of the last 40 seconds performing garbage
  245. collection.
  246. [source,log]
  247. ----
  248. [timestamp_short_interval_from_last][INFO ][o.e.m.j.JvmGcMonitorService] [node_id] [gc][number] overhead, spent [21s] collecting in the last [40s]
  249. ----
  250. [discrete]
  251. [[reduce-jvm-memory-pressure]]
  252. ==== Reduce JVM memory pressure
  253. **Reduce your shard count**
  254. Every shard uses memory. In most cases, a small set of large shards uses fewer
  255. resources than many small shards. For tips on reducing your shard count, see
  256. <<size-your-shards>>.
  257. [[avoid-expensive-searches]]
  258. **Avoid expensive searches**
  259. Expensive searches can use large amounts of memory. To better track expensive
  260. searches on your cluster, enable <<index-modules-slowlog,slow logs>>.
  261. Expensive searches may have a large <<paginate-search-results,`size` argument>>,
  262. use aggregations with a large number of buckets, or include
  263. <<query-dsl-allow-expensive-queries,expensive queries>>. To prevent expensive
  264. searches, consider the following setting changes:
  265. * Lower the `size` limit using the
  266. <<index-max-result-window,`index.max_result_window`>> index setting.
  267. * Decrease the maximum number of allowed aggregation buckets using the
  268. <<search-settings-max-buckets,search.max_buckets>> cluster setting.
  269. * Disable expensive queries using the
  270. <<query-dsl-allow-expensive-queries,`search.allow_expensive_queries`>> cluster
  271. setting.
  272. [source,console]
  273. ----
  274. PUT _settings
  275. {
  276. "index.max_result_window": 5000
  277. }
  278. PUT _cluster/settings
  279. {
  280. "persistent": {
  281. "search.max_buckets": 20000,
  282. "search.allow_expensive_queries": false
  283. }
  284. }
  285. ----
  286. // TEST[s/^/PUT my-index\n/]
  287. **Prevent mapping explosions**
  288. Defining too many fields or nesting fields too deeply can lead to
  289. <<mapping-limit-settings,mapping explosions>> that use large amounts of memory.
  290. To prevent mapping explosions, use the <<mapping-settings-limit,mapping limit
  291. settings>> to limit the number of field mappings.
  292. **Spread out bulk requests**
  293. While more efficient than individual requests, large <<docs-bulk,bulk indexing>>
  294. or <<search-multi-search,multi-search>> requests can still create high JVM
  295. memory pressure. If possible, submit smaller requests and allow more time
  296. between them.
  297. **Upgrade node memory**
  298. Heavy indexing and search loads can cause high JVM memory pressure. To better
  299. handle heavy workloads, upgrade your nodes to increase their memory capacity.
  300. [discrete]
  301. [[red-yellow-cluster-status]]
  302. === Red or yellow cluster status
  303. A red or yellow cluster status indicates one or more shards are missing or
  304. unallocated. These unassigned shards increase your risk of data loss and can
  305. degrade cluster performance.
  306. [discrete]
  307. [[diagnose-cluster-status]]
  308. ==== Diagnose your cluster status
  309. **Check your cluster status**
  310. Use the <<cluster-health,cluster health API>>.
  311. [source,console]
  312. ----
  313. GET _cluster/health?filter_path=status,*_shards
  314. ----
  315. A healthy cluster has a green `status` and zero `unassigned_shards`. A yellow
  316. status means only replicas are unassigned. A red status means one or
  317. more primary shards are unassigned.
  318. **View unassigned shards**
  319. To view unassigned shards, use the <<cat-shards,cat shards API>>.
  320. [source,console]
  321. ----
  322. GET _cat/shards?v=true&h=index,shard,prirep,state,node,unassigned.reason&s=state
  323. ----
  324. Unassigned shards have a `state` of `UNASSIGNED`. The `prirep` value is `p` for
  325. primary shards and `r` for replicas. The `unassigned.reason` describes why the
  326. shard remains unassigned.
  327. To get a more in-depth explanation of an unassigned shard's allocation status,
  328. use the <<cluster-allocation-explain,cluster allocation explanation API>>. You
  329. can often use details in the response to resolve the issue.
  330. [source,console]
  331. ----
  332. GET _cluster/allocation/explain?filter_path=index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*
  333. {
  334. "index": "my-index",
  335. "shard": 0,
  336. "primary": false,
  337. "current_node": "my-node"
  338. }
  339. ----
  340. // TEST[s/^/PUT my-index\n/]
  341. // TEST[s/"primary": false,/"primary": false/]
  342. // TEST[s/"current_node": "my-node"//]
  343. [discrete]
  344. [[fix-red-yellow-cluster-status]]
  345. ==== Fix a red or yellow cluster status
  346. A shard can become unassigned for several reasons. The following tips outline the
  347. most common causes and their solutions.
  348. **Re-enable shard allocation**
  349. You typically disable allocation during a <<restart-cluster,restart>> or other
  350. cluster maintenance. If you forgot to re-enable allocation afterward, {es} will
  351. be unable to assign shards. To re-enable allocation, reset the
  352. `cluster.routing.allocation.enable` cluster setting.
  353. [source,console]
  354. ----
  355. PUT _cluster/settings
  356. {
  357. "persistent" : {
  358. "cluster.routing.allocation.enable" : null
  359. }
  360. }
  361. ----
  362. **Recover lost nodes**
  363. Shards often become unassigned when a data node leaves the cluster. This can
  364. occur for several reasons, ranging from connectivity issues to hardware failure.
  365. After you resolve the issue and recover the node, it will rejoin the cluster.
  366. {es} will then automatically allocate any unassigned shards.
  367. To avoid wasting resources on temporary issues, {es} <<delayed-allocation,delays
  368. allocation>> by one minute by default. If you've recovered a node and don’t want
  369. to wait for the delay period, you can call the <<cluster-reroute,cluster reroute
  370. API>> with no arguments to start the allocation process. The process runs
  371. asynchronously in the background.
  372. [source,console]
  373. ----
  374. POST _cluster/reroute
  375. ----
  376. **Fix allocation settings**
  377. Misconfigured allocation settings can result in an unassigned primary shard.
  378. These settings include:
  379. * <<shard-allocation-filtering,Shard allocation>> index settings
  380. * <<cluster-shard-allocation-filtering,Allocation filtering>> cluster settings
  381. * <<shard-allocation-awareness,Allocation awareness>> cluster settings
  382. To review your allocation settings, use the <<indices-get-settings,get index
  383. settings>> and <<cluster-get-settings,get cluster settings>> APIs.
  384. [source,console]
  385. ----
  386. GET my-index/_settings?flat_settings=true&include_defaults=true
  387. GET _cluster/settings?flat_settings=true&include_defaults=true
  388. ----
  389. // TEST[s/^/PUT my-index\n/]
  390. You can change the settings using the <<indices-update-settings,update index
  391. settings>> and <<cluster-update-settings,cluster update settings>> APIs.
  392. **Allocate or reduce replicas**
  393. To protect against hardware failure, {es} will not assign a replica to the same
  394. node as its primary shard. If no other data nodes are available to host the
  395. replica, it remains unassigned. To fix this, you can:
  396. * Add a data node to the same tier to host the replica.
  397. * Change the `index.number_of_replicas` index setting to reduce the number of
  398. replicas for each primary shard. We recommend keeping at least one replica per
  399. primary.
  400. [source,console]
  401. ----
  402. PUT _settings
  403. {
  404. "index.number_of_replicas": 1
  405. }
  406. ----
  407. // TEST[s/^/PUT my-index\n/]
  408. **Free up or increase disk space**
  409. {es} uses a <<disk-based-shard-allocation,low disk watermark>> to ensure data
  410. nodes have enough disk space for incoming shards. By default, {es} does not
  411. allocate shards to nodes using more than 85% of disk space.
  412. To check the current disk space of your nodes, use the <<cat-allocation,cat
  413. allocation API>>.
  414. [source,console]
  415. ----
  416. GET _cat/allocation?v=true&h=node,shards,disk.*
  417. ----
  418. If your nodes are running low on disk space, you have a few options:
  419. * Upgrade your nodes to increase disk space.
  420. * Delete unneeded indices to free up space. If you use {ilm-init}, you can
  421. update your lifecycle policy to use <<ilm-searchable-snapshot,searchable
  422. snapshots>> or add a delete phase. If you no longer need to search the data, you
  423. can use a <<snapshot-restore,snapshot>> to store it off-cluster.
  424. * If you no longer write to an index, use the <<indices-forcemerge,force merge
  425. API>> or {ilm-init}'s <<ilm-forcemerge,force merge action>> to merge its
  426. segments into larger ones.
  427. +
  428. [source,console]
  429. ----
  430. POST my-index/_forcemerge
  431. ----
  432. // TEST[s/^/PUT my-index\n/]
  433. * If an index is read-only, use the <<indices-shrink-index,shrink index API>> or
  434. {ilm-init}'s <<ilm-shrink,shrink action>> to reduce its primary shard count.
  435. +
  436. [source,console]
  437. ----
  438. POST my-index/_shrink/my-shrunken-index
  439. ----
  440. // TEST[s/^/PUT my-index\n{"settings":{"index.number_of_shards":2,"blocks.write":true}}\n/]
  441. * If your node has a large disk capacity, you can increase the low disk
  442. watermark or set it to an explicit byte value.
  443. +
  444. [source,console]
  445. ----
  446. PUT _cluster/settings
  447. {
  448. "persistent": {
  449. "cluster.routing.allocation.disk.watermark.low": "30gb"
  450. }
  451. }
  452. ----
  453. // TEST[s/"30gb"/null/]
  454. **Reduce JVM memory pressure**
  455. Shard allocation requires JVM heap memory. High JVM memory pressure can trigger
  456. <<circuit-breaker,circuit breakers>> that stop allocation and leave shards
  457. unassigned. See <<high-jvm-memory-pressure>>.
  458. **Recover data for a lost primary shard**
  459. If a node containing a primary shard is lost, {es} can typically replace it
  460. using a replica on another node. If you can't recover the node and replicas
  461. don't exist or are irrecoverable, you'll need to re-add the missing data from a
  462. <<snapshot-restore,snapshot>> or the original data source.
  463. WARNING: Only use this option if node recovery is no longer possible. This
  464. process allocates an empty primary shard. If the node later rejoins the cluster,
  465. {es} will overwrite its primary shard with data from this newer empty shard,
  466. resulting in data loss.
  467. Use the <<cluster-reroute,cluster reroute API>> to manually allocate the
  468. unassigned primary shard to another data node in the same tier. Set
  469. `accept_data_loss` to `true`.
  470. [source,console]
  471. ----
  472. POST _cluster/reroute
  473. {
  474. "commands": [
  475. {
  476. "allocate_empty_primary": {
  477. "index": "my-index",
  478. "shard": 0,
  479. "node": "my-node",
  480. "accept_data_loss": "true"
  481. }
  482. }
  483. ]
  484. }
  485. ----
  486. // TEST[s/^/PUT my-index\n/]
  487. // TEST[catch:bad_request]
  488. If you backed up the missing index data to a snapshot, use the
  489. <<restore-snapshot-api,restore snapshot API>> to restore the individual index.
  490. Alternatively, you can index the missing data from the original data source.
  491. [discrete]
  492. [[rejected-requests]]
  493. === Rejected requests
  494. When {es} rejects a request, it stops the operation and returns an error with a
  495. `429` response code. Rejected requests are commonly caused by:
  496. * A <<high-cpu-usage,depleted thread pool>>. A depleted `search` or `write`
  497. thread pool returns a `TOO_MANY_REQUESTS` error message.
  498. * A <<circuit-breaker-errors,circuit breaker error>>.
  499. * High <<index-modules-indexing-pressure,indexing pressure>> that exceeds the
  500. <<memory-limits,`indexing_pressure.memory.limit`>>.
  501. [discrete]
  502. [[check-rejected-tasks]]
  503. ==== Check rejected tasks
  504. To check the number of rejected tasks for each thread pool, use the
  505. <<cat-thread-pool,cat thread pool API>>. A high ratio of `rejected` to
  506. `completed` tasks, particularly in the `search` and `write` thread pools, means
  507. {es} regularly rejects requests.
  508. [source,console]
  509. ----
  510. GET /_cat/thread_pool?v=true&h=id,name,active,rejected,completed
  511. ----
  512. [discrete]
  513. [[prevent-rejected-requests]]
  514. ==== Prevent rejected requests
  515. **Fix high CPU and memory usage**
  516. If {es} regularly rejects requests and other tasks, your cluster likely has high
  517. CPU usage or high JVM memory pressure. For tips, see <<high-cpu-usage>> and
  518. <<high-jvm-memory-pressure>>.
  519. **Prevent circuit breaker errors**
  520. If you regularly trigger circuit breaker errors, see <<circuit-breaker-errors>>
  521. for tips on diagnosing and preventing them.