sqlalchemy / sqlalchemy/dogpile.cache

Backend-level expiration / resource deallocation

Open
#230 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
299
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Can someone please either confirm or refute my understanding: unless I specify the arguments.memcached_expire_time config option, the keys/values never actually expire in the Memcached itself. It's just that Dogpile considers them expired by checking the expiration times, but actual data don't get deallocated from the underlying Memcached storage (which is RAM). This is probably also true for other backends.

I'm actually concerned about resource deallocation by Memcached. And I guess the reason that the current behavior does not lead to (m)any complaints/problems in practice is that Memcached is typically configured with some memory limit, and when it's reached it's just starting to evict old keys.

So, to summarize it: under typical configuration of Dogpile (no arguments.memcached_expire_time specified), cached data is not deleted from Memcached leading to more resource usage than with that config option set to a reasonable timeout.

(Of course, I'm assuming that we're not calling cache_region.delete() explicitly.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how arguments.memcached_expire_time affects Memcached entries and how cache_region.delete() is handled. Compare expiration and resource usage with and without that option, then establish whether the reported backend-level deallocation behavior is expected and what change or documentation would be needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
memcached, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.