Introduction to Memcached Metrics

What is memcached?

memcached is a high-performance memory caching system used to reduce database query volume and improve application response times.

Cache Hit Rate

Cache hit rate refers to the number of cache hits when executing a batch of operations. Typically, the target value for cache hit rate is above 80%. This means that out of every 100 queries, 80 can be retrieved directly from the cache, requiring only one read or write operation.

Throughput

Throughput refers to the rate at which requests are processed per unit of time. memcached's throughput is influenced by multiple factors, including cache size, data pressure, and system hardware configuration.

Latency

Latency refers to the time required from receiving a request to returning a result. This includes the time from starting to look up the cache to reading or writing data, as well as the time from writing data to returning the result. The target latency for memcached is typically below 10ms.

Other Important Metrics:

Remainder (Cache hit ratio)

Remainder refers to the remaining value of the cache hit rate when executing a batch of operations, calculated as (cache hit rate - 1) * 100.

Average Cache Size

Average cache size refers to the average total size of all cache blocks in the entire system, usually expressed in MB or GB.

Pros and Cons of memcached:

Pros: High performance, high availability, easy to manage and scale.

Cons: Requires frequent refreshing and clearing, and data may be lost.