Perf histograms

The perf histograms build on perf counters infrastructure. Histograms are built for a number of counters and simplify gathering data on which groups of counter values occur most often over time.Perf histograms are currently unsigned 64-bit integer counters, so they’re mostly useful for time and sizes. Data dumped by perf histogram can then be feed into other analysis tools/scripts.

Access

The perf histogram data are accessed via the admin socket. For example:

  1. ceph daemon osd.0 perf histogram schema
  2. ceph daemon osd.0 perf histogram dump

Collections

The histograms are grouped into named collections, normally representing a subsystem or an instance of a subsystem. For example, the internal throttle mechanism reports statistics on how it is throttling, and each instance is named something like:

  1. op_r_latency_out_bytes_histogram
  2. op_rw_latency_in_bytes_histogram
  3. op_rw_latency_out_bytes_histogram
  4. ...

Schema

The perf histogram schema command dumps a json description of which values are available, and what their type is. Each named value as a type bitfield, with the 5-th bit always set and following bits defined.

bitmeaning
1floating point value
2unsigned 64-bit integer value
4average (sum + count pair)
8counter (vs gauge)

In other words, histogram of type “18” is a histogram of unsigned 64-bit integer values (16 + 2).

Here is an example of the schema output:

  1. {
  2. "AsyncMessenger::Worker-0": {},
  3. "AsyncMessenger::Worker-1": {},
  4. "AsyncMessenger::Worker-2": {},
  5. "mutex-WBThrottle::lock": {},
  6. "objecter": {},
  7. "osd": {
  8. "op_r_latency_out_bytes_histogram": {
  9. "type": 18,
  10. "description": "Histogram of operation latency (including queue time) + da ta read",
  11. "nick": ""
  12. },
  13. "op_w_latency_in_bytes_histogram": {
  14. "type": 18,
  15. "description": "Histogram of operation latency (including queue time) + da ta written",
  16. "nick": ""
  17. },
  18. "op_rw_latency_in_bytes_histogram": {
  19. "type": 18,
  20. "description": "Histogram of rw operation latency (including queue time) + data written",
  21. "nick": ""
  22. },
  23. "op_rw_latency_out_bytes_histogram": {
  24. "type": 18,
  25. "description": "Histogram of rw operation latency (including queue time) + data read",
  26. "nick": ""
  27. }
  28. }
  29. }

Dump

The actual dump is similar to the schema, except that there are actual value groups. For example:

  1. "osd": {
  2. "op_r_latency_out_bytes_histogram": {
  3. "axes": [
  4. {
  5. "name": "Latency (usec)",
  6. "min": 0,
  7. "quant_size": 100000,
  8. "buckets": 32,
  9. "scale_type": "log2",
  10. "ranges": [
  11. {
  12. "max": -1
  13. },
  14. {
  15. "min": 0,
  16. "max": 99999
  17. },
  18. {
  19. "min": 100000,
  20. "max": 199999
  21. },
  22. {
  23. "min": 200000,
  24. "max": 399999
  25. },
  26. {
  27. "min": 400000,
  28. "max": 799999
  29. },
  30. {
  31. "min": 800000,
  32. "max": 1599999
  33. },
  34. {
  35. "min": 1600000,
  36. "max": 3199999
  37. },
  38. {
  39. "min": 3200000,
  40. "max": 6399999
  41. },
  42. {
  43. "min": 6400000,
  44. "max": 12799999
  45. },
  46. {
  47. "min": 12800000,
  48. "max": 25599999
  49. },
  50. {
  51. "min": 25600000,
  52. "max": 51199999
  53. },
  54. {
  55. "min": 51200000,
  56. "max": 102399999
  57. },
  58. {
  59. "min": 102400000,
  60. "max": 204799999
  61. },
  62. {
  63. "min": 204800000,
  64. "max": 409599999
  65. },
  66. {
  67. "min": 409600000,
  68. "max": 819199999
  69. },
  70. {
  71. "min": 819200000,
  72. "max": 1638399999
  73. },
  74. {
  75. "min": 1638400000,
  76. "max": 3276799999
  77. },
  78. {
  79. "min": 3276800000,
  80. "max": 6553599999
  81. },
  82. {
  83. "min": 6553600000,
  84. "max": 13107199999
  85. },
  86. {
  87. "min": 13107200000,
  88. "max": 26214399999
  89. },
  90. {
  91. "min": 26214400000,
  92. "max": 52428799999
  93. },
  94. {
  95. "min": 52428800000,
  96. "max": 104857599999
  97. },
  98. {
  99. "min": 104857600000,
  100. "max": 209715199999
  101. },
  102. {
  103. "min": 209715200000,
  104. "max": 419430399999
  105. },
  106. {
  107. "min": 419430400000,
  108. "max": 838860799999
  109. },
  110. {
  111. "min": 838860800000,
  112. "max": 1677721599999
  113. },
  114. {
  115. "min": 1677721600000,
  116. "max": 3355443199999
  117. },
  118. {
  119. "min": 3355443200000,
  120. "max": 6710886399999
  121. },
  122. {
  123. "min": 6710886400000,
  124. "max": 13421772799999
  125. },
  126. {
  127. "min": 13421772800000,
  128. "max": 26843545599999
  129. },
  130. {
  131. "min": 26843545600000,
  132. "max": 53687091199999
  133. },
  134. },
  135. {
  136. "min": 53687091200000
  137. }
  138. ]
  139. },
  140. {
  141. "name": "Request size (bytes)",
  142. "min": 0,
  143. "quant_size": 512,
  144. "buckets": 32,
  145. "scale_type": "log2",
  146. "ranges": [
  147. {
  148. "max": -1
  149. },
  150. {
  151. "min": 0,
  152. "max": 511
  153. },
  154. {
  155. "min": 512,
  156. "max": 1023
  157. },
  158. {
  159. "min": 1024,
  160. "max": 2047
  161. },
  162. {
  163. "min": 2048,
  164. "max": 4095
  165. },
  166. {
  167. "min": 4096,
  168. "max": 8191
  169. },
  170. {
  171. "min": 8192,
  172. "max": 16383
  173. },
  174. {
  175. "min": 16384,
  176. "max": 32767
  177. },
  178. {
  179. "min": 32768,
  180. "max": 65535
  181. },
  182. {
  183. "min": 65536,
  184. "max": 131071
  185. },
  186. {
  187. "min": 131072,
  188. "max": 262143
  189. },
  190. {
  191. "min": 262144,
  192. "max": 524287
  193. },
  194. {
  195. "min": 524288,
  196. "max": 1048575
  197. },
  198. {
  199. "min": 1048576,
  200. "max": 2097151
  201. },
  202. {
  203. "min": 2097152,
  204. "max": 4194303
  205. },
  206. {
  207. "min": 4194304,
  208. "max": 8388607
  209. },
  210. {
  211. "min": 8388608,
  212. "max": 16777215
  213. },
  214. {
  215. "min": 16777216,
  216. "max": 33554431
  217. },
  218. {
  219. "min": 33554432,
  220. "max": 67108863
  221. },
  222. {
  223. "min": 67108864,
  224. "max": 134217727
  225. },
  226. {
  227. "min": 134217728,
  228. "max": 268435455
  229. },
  230. {
  231. "min": 268435456,
  232. "max": 536870911
  233. },
  234. {
  235. "min": 536870912,
  236. "max": 1073741823
  237. },
  238. {
  239. "min": 1073741824,
  240. "max": 2147483647
  241. },
  242. {
  243. "min": 2147483648,
  244. "max": 4294967295
  245. },
  246. {
  247. "min": 4294967296,
  248. "max": 8589934591
  249. },
  250. {
  251. "min": 8589934592,
  252. "max": 17179869183
  253. },
  254. {
  255. "min": 17179869184,
  256. "max": 34359738367
  257. },
  258. {
  259. "min": 34359738368,
  260. "max": 68719476735
  261. },
  262. {
  263. "min": 68719476736,
  264. "max": 137438953471
  265. },
  266. {
  267. "min": 137438953472,
  268. "max": 274877906943
  269. },
  270. {
  271. "min": 274877906944
  272. }
  273. ]
  274. }
  275. ],
  276. "values": [
  277. [
  278. 0,
  279. 0,
  280. 0,
  281. 0,
  282. 0,
  283. 0,
  284. 0,
  285. 0,
  286. 0,
  287. 0,
  288. 0,
  289. 0,
  290. 0,
  291. 0,
  292. 0,
  293. 0,
  294. 0,
  295. 0,
  296. 0,
  297. 0,
  298. 0,
  299. 0,
  300. 0,
  301. 0,
  302. 0,
  303. 0,
  304. 0,
  305. 0,
  306. 0,
  307. 0,
  308. 0,
  309. 0
  310. ],
  311. [
  312. 0,
  313. 0,
  314. 0,
  315. 0,
  316. 0,
  317. 0,
  318. 0,
  319. 0,
  320. 0,
  321. 0,
  322. 0,
  323. 0,
  324. 0,
  325. 0,
  326. 0,
  327. 0,
  328. 0,
  329. 0,
  330. 0,
  331. 0,
  332. 0,
  333. 0,
  334. 0,
  335. 0,
  336. 0,
  337. 0,
  338. 0,
  339. 0,
  340. 0,
  341. 0,
  342. 0,
  343. 0
  344. ],
  345. [
  346. 0,
  347. 0,
  348. 0,
  349. 0,
  350. 0,
  351. 0,
  352. 0,
  353. 0,
  354. 0,
  355. 0,
  356. 0,
  357. 0,
  358. 0,
  359. 0,
  360. 0,
  361. 0,
  362. 0,
  363. 0,
  364. 0,
  365. 0,
  366. 0,
  367. 0,
  368. 0,
  369. 0,
  370. 0,
  371. 0,
  372. 0,
  373. 0,
  374. 0,
  375. 0,
  376. 0,
  377. 0
  378. ],
  379. [
  380. 0,
  381. 0,
  382. 0,
  383. 0,
  384. 0,
  385. 0,
  386. 0,
  387. 0,
  388. 0,
  389. 0,
  390. 0,
  391. 0,
  392. 0,
  393. 0,
  394. 0,
  395. 0,
  396. 0,
  397. 0,
  398. 0,
  399. 0,
  400. 0,
  401. 0,
  402. 0,
  403. 0,
  404. 0,
  405. 0,
  406. 0,
  407. 0,
  408. 0,
  409. 0,
  410. 0,
  411. 0
  412. ],
  413. [
  414. 0,
  415. 0,
  416. 0,
  417. 0,
  418. 0,
  419. 0,
  420. 0,
  421. 0,
  422. 0,
  423. 0,
  424. 0,
  425. 0,
  426. 0,
  427. 0,
  428. 0,
  429. 0,
  430. 0,
  431. 0,
  432. 0,
  433. 0,
  434. 0,
  435. 0,
  436. 0,
  437. 0,
  438. 0,
  439. 0,
  440. 0,
  441. 0,
  442. 0,
  443. 0,
  444. 0,
  445. 0
  446. ],
  447. [
  448. 0,
  449. 0,
  450. 0,
  451. 0,
  452. 0,
  453. 0,
  454. 0,
  455. 0,
  456. 0,
  457. 0,
  458. 0,
  459. 0,
  460. 0,
  461. 0,
  462. 0,
  463. 0,
  464. 0,
  465. 0,
  466. 0,
  467. 0,
  468. 0,
  469. 0,
  470. 0,
  471. 0,
  472. 0,
  473. 0,
  474. 0,
  475. 0,
  476. 0,
  477. 0,
  478. 0,
  479. 0
  480. ],
  481. [
  482. 0,
  483. 0,
  484. 0,
  485. 0,
  486. 0,
  487. 0,
  488. 0,
  489. 0,
  490. 0,
  491. 0,
  492. 0,
  493. 0,
  494. 0,
  495. 0,
  496. 0,
  497. 0,
  498. 0,
  499. 0,
  500. 0,
  501. 0,
  502. 0,
  503. 0,
  504. 0,
  505. 0,
  506. 0,
  507. 0,
  508. 0,
  509. 0,
  510. 0,
  511. 0,
  512. 0,
  513. 0
  514. ],
  515. [
  516. 0,
  517. 0,
  518. 0,
  519. 0,
  520. 0,
  521. 0,
  522. 0,
  523. 0,
  524. 0,
  525. 0,
  526. 0,
  527. 0,
  528. 0,
  529. 0,
  530. 0,
  531. 0,
  532. 0,
  533. 0,
  534. 0,
  535. 0,
  536. 0,
  537. 0,
  538. 0,
  539. 0,
  540. 0,
  541. 0,
  542. 0,
  543. 0,
  544. 0,
  545. 0,
  546. 0,
  547. 0
  548. ],
  549. [
  550. 0,
  551. 0,
  552. 0,
  553. 0,
  554. 0,
  555. 0,
  556. 0,
  557. 0,
  558. 0,
  559. 0,
  560. 0,
  561. 0,
  562. 0,
  563. 0,
  564. 0,
  565. 0,
  566. 0,
  567. 0,
  568. 0,
  569. 0,
  570. 0,
  571. 0,
  572. 0,
  573. 0,
  574. 0,
  575. 0,
  576. 0,
  577. 0,
  578. 0,
  579. 0,
  580. 0,
  581. 0
  582. ]
  583. ]
  584. }
  585. },

This represents the 2d histogram, consisting of 9 history entrires and 32 value groups per each history entry.“Ranges” element denote value bounds for each of value groups. “Buckets” denote amount of value groups (“buckets”),“Min” is a minimum accepted valaue, “quant_size” is quantization unit and “scale_type” is either “log2” (logarhitmicscale) or “linear” (linear scale).You can use histogram_dump.py tool (see src/tools/histogram_dump.py) for quick visualisation of existing histogramdata.