php-memcached-dev / php-memcached

memcached extension based on libmemcached library
Other
988 stars 323 forks source link

Memcached memory to infinite after PHP update/restart #478

Open cappadaan opened 3 years ago

cappadaan commented 3 years ago

Memcached v3.1.5 PHP 7.4.14

After every minor PHP update (and restart) I experience my memcached to start climbing in memory consumption fast. This eventually causes Memcached to stop working at all. A restart of memcached solves the problem, but this not ideal because my PHP sessions are in Memcached.

Does anyone else also have experienced this problem? Is there any way to debug what it could cause?

sodabrew commented 3 years ago

This is completely normal. Your memcached is filling up with data as you begin using it. This is how it works! Memcached does not proactively recover memory; rather, it fills until it's full and then begins evicting records that are either a) past their TTL or b) Least Recently Used within their respective object-size-buckets.

cappadaan commented 3 years ago

Maybe I was not clear enough. The server RAM is climbing to 100% caused by memcached and at a sudden point memcached completely stops working, no evictions are taking place.

This is only the case after updating PHP.

sodabrew commented 3 years ago

The default limit for the memcached server is 64MB (-m command line option) maybe yours is set too high?

m6w6 commented 3 years ago

Are both of you talking about the same thing? I.e. php-memcached extension vs memcached server? Just a wild guess.