public
Description: This is where my memcached work lives before svn munges the changes.
Homepage: http://www.danga.com/memcached/
Clone URL: git://github.com/dustin/memcached.git
Search Repo:
Document a few of the stats commands.


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

Comments

    No one has commented yet.