thread_pool.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. [[cat-thread-pool]]
  2. == cat thread pool
  3. The `thread_pool` command shows cluster wide thread pool statistics per node. By default the active, queue and rejected
  4. statistics are returned for all thread pools.
  5. [source,js]
  6. --------------------------------------------------
  7. GET /_cat/thread_pool
  8. --------------------------------------------------
  9. // CONSOLE
  10. Which looks like:
  11. [source,txt]
  12. --------------------------------------------------
  13. node-0 bulk 0 0 0
  14. node-0 fetch_shard_started 0 0 0
  15. node-0 fetch_shard_store 0 0 0
  16. node-0 flush 0 0 0
  17. node-0 force_merge 0 0 0
  18. node-0 generic 0 0 0
  19. node-0 get 0 0 0
  20. node-0 index 0 0 0
  21. node-0 listener 0 0 0
  22. node-0 management 1 0 0
  23. node-0 refresh 0 0 0
  24. node-0 search 0 0 0
  25. node-0 snapshot 0 0 0
  26. node-0 warmer 0 0 0
  27. --------------------------------------------------
  28. // TESTRESPONSE[s/\d+/\\d+/ _cat]
  29. The first column is the node name
  30. [source,txt]
  31. --------------------------------------------------
  32. node_name
  33. node-0
  34. --------------------------------------------------
  35. The second column is the thread pool name
  36. [source,txt]
  37. --------------------------------------------------
  38. name
  39. bulk
  40. fetch_shard_started
  41. fetch_shard_store
  42. flush
  43. force_merge
  44. generic
  45. get
  46. index
  47. listener
  48. management
  49. refresh
  50. search
  51. snapshot
  52. warmer
  53. --------------------------------------------------
  54. The next three columns show the active, queue, and rejected statistics for each thread pool
  55. [source,txt]
  56. --------------------------------------------------
  57. active queue rejected
  58. 0 0 0
  59. 0 0 0
  60. 0 0 0
  61. 0 0 0
  62. 0 0 0
  63. 0 0 0
  64. 0 0 0
  65. 0 0 0
  66. 0 0 0
  67. 1 0 0
  68. 0 0 0
  69. 0 0 0
  70. 0 0 0
  71. 0 0 0
  72. --------------------------------------------------
  73. The cat thread pool API accepts a `thread_pool_patterns` URL parameter for specifying a
  74. comma-separated list of regular expressions to match thread pool names.
  75. [source,js]
  76. --------------------------------------------------
  77. GET /_cat/thread_pool/generic?v&h=id,name,active,rejected,completed
  78. --------------------------------------------------
  79. // CONSOLE
  80. which looks like:
  81. [source,js]
  82. --------------------------------------------------
  83. id name active rejected completed
  84. 0EWUhXeBQtaVGlexUeVwMg generic 0 0 70
  85. --------------------------------------------------
  86. // TESTRESPONSE[s/0EWUhXeBQtaVGlexUeVwMg/[\\w-]+/ s/\d+/\\d+/ _cat]
  87. Here the host columns and the active, rejected and completed suggest thread pool statistics are displayed.
  88. All <<modules-threadpool,built-in thread pools>> and custom thread pools are available.
  89. [float]
  90. ==== Thread Pool Fields
  91. For each thread pool, you can load details about it by using the field names
  92. in the table below.
  93. [cols="<,<,<",options="header"]
  94. |=======================================================================
  95. |Field Name |Alias |Description
  96. |`type` |`t` |The current (*) type of thread pool (`fixed` or `scaling`)
  97. |`active` |`a` |The number of active threads in the current thread pool
  98. |`size` |`s` |The number of threads in the current thread pool
  99. |`queue` |`q` |The number of tasks in the queue for the current thread pool
  100. |`queue_size` |`qs` |The maximum number of tasks permitted in the queue for the current thread pool
  101. |`rejected` |`r` |The number of tasks rejected by the thread pool executor
  102. |`largest` |`l` |The highest number of active threads in the current thread pool
  103. |`completed` |`c` |The number of tasks completed by the thread pool executor
  104. |`min` |`mi` |The configured minimum number of active threads allowed in the current thread pool
  105. |`max` |`ma` |The configured maximum number of active threads allowed in the current thread pool
  106. |`keep_alive` |`k` |The configured keep alive time for threads
  107. |=======================================================================
  108. [float]
  109. === Other Fields
  110. In addition to details about each thread pool, it is also convenient to get an
  111. understanding of where those thread pools reside. As such, you can request
  112. other details like the `ip` of the responding node(s).
  113. [cols="<,<,<",options="header"]
  114. |=======================================================================
  115. |Field Name |Alias |Description
  116. |`node_id` |`id` |The unique node ID
  117. |`ephemeral_id`|`eid` |The ephemeral node ID
  118. |`pid` |`p` |The process ID of the running node
  119. |`host` |`h` |The hostname for the current node
  120. |`ip` |`i` |The IP address for the current node
  121. |`port` |`po` |The bound transport port for the current node
  122. |=======================================================================