| | 412 | Item statistics |
|---|
| | 413 | --------------- |
|---|
| | 414 | CAVEAT: This section describes statistics which are subject to change in the |
|---|
| | 415 | future. |
|---|
| | 416 | |
|---|
| | 417 | The "stats" command with the argument of "items" returns information about |
|---|
| | 418 | item storage per slab class. The data is returned in the format: |
|---|
| | 419 | |
|---|
| | 420 | STAT items:<slabclass>:<stat> <value>\r\n |
|---|
| | 421 | |
|---|
| | 422 | The server terminates this list with the line |
|---|
| | 423 | |
|---|
| | 424 | END\r\n |
|---|
| | 425 | |
|---|
| | 426 | The slabclass aligns with class ids used by the "stats slabs" command. Where |
|---|
| | 427 | "stats slabs" describes size and memory usage, "stats items" shows higher |
|---|
| | 428 | level information. |
|---|
| | 429 | |
|---|
| | 430 | The following item values are defined as of writing. |
|---|
| | 431 | |
|---|
| | 432 | Name Meaning |
|---|
| | 433 | ------------------------------ |
|---|
| | 434 | number Number of items presently stored in this class. Expired |
|---|
| | 435 | items are not automatically excluded. |
|---|
| | 436 | age Age of the oldest item in the LRU. |
|---|
| | 437 | evicted Number of times an item had to be evicted from the LRU |
|---|
| | 438 | before it expired. |
|---|
| | 439 | outofmemory Number of times the underlying slab class was unable to |
|---|
| | 440 | store a new item. This means you are running with -M or |
|---|
| | 441 | an eviction failed. |
|---|
| | 442 | |
|---|
| | 443 | Note this will only display information about slabs which exist, so an empty |
|---|
| | 444 | cache will return an empty set. |
|---|
| | 445 | |
|---|
| | 446 | |
|---|
| | 447 | Item size statistics |
|---|
| | 448 | -------------------- |
|---|
| | 449 | CAVEAT: This section describes statistics which are subject to change in the |
|---|
| | 450 | future. |
|---|
| | 451 | |
|---|
| | 452 | The "stats" command with the argument of "sizes" returns information about the |
|---|
| | 453 | general size and count of all items stored in the cache. |
|---|
| | 454 | WARNING: This command WILL lock up your cache! It iterates over *every item* |
|---|
| | 455 | and examines the size. While the operation is fast, if you have many items |
|---|
| | 456 | you could prevent memcached from serving requests for several seconds. |
|---|
| | 457 | |
|---|
| | 458 | The data is returned in the following format: |
|---|
| | 459 | |
|---|
| | 460 | <size> <count>\r\n |
|---|
| | 461 | |
|---|
| | 462 | The server terminates this list with the line |
|---|
| | 463 | |
|---|
| | 464 | END\r\n |
|---|
| | 465 | |
|---|
| | 466 | 'size' is an approximate size of the item, within 32 bytes. |
|---|
| | 467 | 'count' is the amount of items that exist within that 32-byte range. |
|---|
| | 468 | |
|---|
| | 469 | This is essentially a display of all of your items if there was a slab class |
|---|
| | 470 | for every 32 bytes. You can use this to determine if adjusting the slab growth |
|---|
| | 471 | factor would save memory overhead. For example: generating more classes in the |
|---|
| | 472 | lower range could allow items to fit more snugly into their slab classes, if |
|---|
| | 473 | most of your items are less than 200 bytes in size. |
|---|
| | 474 | |
|---|
| | 475 | |
|---|
| | 476 | Slab statistics |
|---|
| | 477 | --------------- |
|---|
| | 478 | CAVEAT: This section describes statistics which are subject to change in the |
|---|
| | 479 | future. |
|---|
| | 480 | |
|---|
| | 481 | The "stats" command with the argument of "slabs" returns information about |
|---|
| | 482 | each of the slabs created by memcached during runtime. This includes per-slab |
|---|
| | 483 | information along with some totals. The data is returned in the format: |
|---|
| | 484 | |
|---|
| | 485 | STAT <slabclass>:<stat> <value>\r\n |
|---|
| | 486 | STAT <stat> <value>\r\n |
|---|
| | 487 | |
|---|
| | 488 | The server terminates this list with the line |
|---|
| | 489 | |
|---|
| | 490 | END\r\n |
|---|
| | 491 | |
|---|
| | 492 | Name Meaning |
|---|
| | 493 | ------------------------------ |
|---|
| | 494 | chunk_size The amount of space each chunk uses. One item will use |
|---|
| | 495 | one chunk of the appropriate size. |
|---|
| | 496 | chunks_per_page How many chunks exist within one page. A page by |
|---|
| | 497 | default is one megabyte in size. Slabs are allocated per |
|---|
| | 498 | page, then broken into chunks. |
|---|
| | 499 | total_pages Total number of pages allocated to the slab class. |
|---|
| | 500 | total_chunks Total number of chunks allocated to the slab class. |
|---|
| | 501 | used_chunks How many chunks have been allocated to items. |
|---|
| | 502 | free_chunks Chunks not yet allocated to items, or freed via delete. |
|---|
| | 503 | free_chunks_end Number of free chunks at the end of the last allocated |
|---|
| | 504 | page. |
|---|
| | 505 | active_slabs Total number of slab classes allocated. |
|---|
| | 506 | total_malloced Total amount of memory allocated to slab pages. |
|---|
| | 507 | |
|---|