Memcached STATS commands

使用者可以使用 STATS 命令,來查看目前 Memcached 運行的狀態。

Jerry’s Notes
What’s next?
3 min readMar 23, 2022

--

Memcached stats command is used to return server statistics such as PID, version, connections, etc.

Memecached 常用操作及 STATS 命令清單

Storage Commands

■ set: Store this data, possibly overwriting any existing data.

■ add: Store this data, only if it does not already exist,

■ replace: Store this data, but only if the data already exists.

■ append: Add this data after the last byte in an existing item.

■ prepend: Same as append, but adding new data before existing data.

■ cas: heck And Set (or Compare And Swap). An operation that stores data, but only if no one else has updated the data since you read it last. Useful for resolving race conditions on updating cache data.

Retrieval Commands

■ get: Command for retrieving data.

■ gets: An alternative get command for using with CAS. Returns a CAS identifier (a unique 64bit number) with the item.

■ delete: Removes an item from the cache, if it exists.

■ incr/decr: Increment and Decrement.

Statistics Commands

■ stats: Return basic stats of the memcached server.

■ stats item: Return items stored in memcached.

!! 輸出 item 資訊 : 獲取像計數,年齡,eviction等由組織ID項目的統計數據

■ stats slabs: Return items stored in memcached. More centered to performance of a slab rather than counts of particular items.

!! 輸出 slab 資訊 : 統計數據,如大小,內存使用情況,命令等數據)

■ stats sizes: A special command that shows you how items would be distributed if slabs were broken into 32byte buckets instead of your current number of slabs. Useful for determining how efficient your slab sizing is.

!! 輸出所有 item 大小和數量

■ flush all: Invalidate all existing cache items. To clear the cache data.

STATS 命令輸出

memcached-tool

--

--

Jerry’s Notes
What’s next?

An cloud support engineer focus on troubleshooting with customer reported issue ,and cloud solution architecture.