Skip to content

"Wasted" calculation breaks when querying Memcached 1.6.7 #2

Description

@iCounsellorUK

Memcached 1.6.7 (Debian "Testing" source) -

Current phpMemCachedAdmin calculation for wasted memory (./Library/Data/Analysis.php ... function public static function slabs($slabs){} ) is:-

$slabs[$id]['mem_wasted'] = (($slab['total_chunks'] * $slab['chunk_size']) < $slab['mem_requested']) ?(($slab['total_chunks'] - $slab['used_chunks']) * $slab['chunk_size']):(($slab['total_chunks'] * $slab['chunk_size']) - $slab['mem_requested']);

With Memcached 1.6.7 this produces a consistent figure of 100% (+/- 1%) waste (yikes!)

Having looked at the data stats slabs returns, I believe this calculation works better for 1.6.7 of Memcached:-

$slabs[$id]['mem_wasted'] = $slab['free_chunks'] * $slab['chunk_size'];

... notwithstanding that my code doesn't take into consideration any previous version of Memcached where free_chunks may not have been returned in the stats slab query.

Added here for info for others who might have the same problem as I.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions