Memcached未删除过期项目



我在AWS Elasticache服务上使用Memcached引擎,我看到了一些奇怪的行为。下面的脚本(我从Stack得到的(列出了所有占用大小+剩余到期时间的密钥。

import traceback
import json
import sys
from pymemcache.client.base import Client
from six import ensure_str
if __name__ == "__main__":
try:
mc = Client('myElasticacheCluster:11211')
keys = {}
for key, val in mc.stats('items').items():
_, slab, field = ensure_str(key).split(':')
if field != 'number' or val == 0:
continue
item_request = mc.stats('cachedump', slab, str(val + 10))
for record, details in item_request.items():
keys[ensure_str(record)] = ensure_str(details)
print('n'.join(f'{k}: {v}' for k, v in keys.items()))
except:
print(traceback.print_exc())

我的问题是memcached显然没有清除过期的项目。有人能给我一盏灯吗?

6623203617684c467b8-0c21-6a0-15c-158431be85f: [19090 b; 1662418410 s]
1662316736412d6e0fd4-73f6-4826-c723-47e6ce0db3: [19200 b; 1662415680 s]
16623107221132235451-e63-863-64f0-cee2b3ec757: [18971 b; 0 s]
1662296187289d0b754f-feb1-1a10-6c0d-d5ebf46004: [20720 b; 1662395851 s]
166223392005886e2062-ce8-7bb6-b24a-14a0586f8dc8: [18575 b; 0 s]
166222067863618ad42-b275-6ca4-271-86db011e5fa2: [19738 b; 0 s]
1662216187586254b1c-871-2db4-43-d4adeb1de1: [20292 b; 0 s]
1662214438346f83c2bb-178e-1ea3-26d6-27dd80c005fc: [18855 b; 1662312584 s]
16622153690636f5f0d-778c-da1-825a-21e178a0a: [18478 b; 0 s]
1662209171636eb50c-30a-54f-e3ab-63a08ee7cf1f: [20202 b; 0 s]
1662165662792d452d55-52e2-cb8e-6d1b-8a74ab510333: [21207 b; 0 s]
166214554259527d26ff-f704-fc36-1230-155264a741: [18242 b; 1662252637 s]
1662150706400cd11305-f3af-3775-04ed-038fdea07d3: [20255 b; 0 s]
1662147721636ee17726-4e1-b4c2-d463-f2f854cd6ac4: [18020 b; 1662247949 s]
16621439053752562c6a-1b6e-ae-1c0d-54bf735b7527: [18170 b; 0 s]
1662141405877cd727aa-8c1-773f-73bf-33a8d5f064fa: [19724 b; 1662238706 s]
166213586047685e634d-dbd7-735b-6fdd-865653ab0aee: [20206 b; 0 s]
1662125482326ed56c03-ab0c-f53e-07eb-d63cf370cc: [17886 b; 1662223366 s]
16621251828812b8ccb-a6af-7573-7f7a-28051a1f5f5: [20720 b; 1662222156 s]
1662122945157e854d7-6e8f-5e45-8048-6da47b1cc73: [18872 b; 1662221332 s]
166206172717075e00e-2f5b-f26a-d4bd-116f654e00e2: [21227 b; 0 s]
16620608120886ee7717-c508-42d4-81a3-af44dafddf32: [21280 b; 1662158103 s]
16620596251423cb1807-eb03-f21a-7a18-4d48f0051ed: [18734 b; 1662157342 s]
1662043945290d527d-747c-d78d-b8a-df8400f3d0: [19432 b; 1662141253 s]
16620497242408d6f4d-3ae-08cb-637e-6e4c85e5fba: [20452 b; 0 s]
166204949632962e58aa-4321-8b08-7668-2b2b770d386e: [20324 b; 0 s]
1662038797835e878d36-66d-828-cccb-d0fccad4211: [21325 b; 0 s]
16620329907221b0aff5-27c-1d-b53-6653638d748f: [20932 b; 0 s]
16619888128963273efa-a420-d40c-6273-075d262b77ab: [17562 b; 1662087379 s]
1661985522694c24f55-d73d-201c-66d7-facc385858c: [19098 b; 0 s]
16619836702192588575-8c4e-d533-5d81-e0ebb2fd3b: [18967 b; 1662081953 s]
1661975444359a75b38-71cf-b134-0672-120f204843d: [17866 b; 1662073872 s]
1661969634948e105d7-1a37-ba55-ed1e-424cafaeb0af: [18298 b; 1662066691 s]
1661964997054b018d45-fb56-2aa0-6425-506f6287c0: [18110 b; 0 s]
1661955619723ff2236-d01-6ea1-176c-8b5a623f151: [18958 b; 1662052527 s]
1661955525460153363-8c8-85dc-653-381a755ca03: [19796 b; 1662052612 s]
16618642764125cbff28-5574-4715-2485-6ef8615b4ca: [18436 b; 1662049137 s]
1661951831769c7d7484-53ff-762e-f082-8712786e8308: [17454 b; 0 s]
1661951133280dd2b87-a0cc-607-28b5-b5632e17ba00: [19926 b; 1662048325 s]
16619459178130d82323-ee42-5dde-386d-af18ec1ba8d: [18676 b; 0 s]
166190038012746eb217-8d5c-434e-c5ac-f4f74206ef51: [19212 b; 0 s]
166188747136572bd81-564a-2a8c-853a-6d1a247667b: [18097 b; 1661996458 s]
1661865840717daf8b8c-b8b7-ffec-c84a-86ec0eccb548: [17838 b; 0 s]
166187436814662e700-b1e4-4af6-8733-0e3c842e7c: [17386 b; 1661971519 s]
16618630620301377f1-173c-6487-5bf0-f1c2d1e35fbf: [19006 b; 0 s]
1661859693931ec263a-d4ca-0a08-ed2f-ca748dfca5d: [19911 b; 0 s]
16618199445844766005-470d-d145-ca73-060ebb74d656: [17646 b; 1661917593 s]
1661806035730512d31e-02e6-cf1-61f-6a32e488deb: [19292 b; 1661910731 s]
166181044983104d67e5-1428-755-b51-848a274376e: [18557 b; 1661908095 s]
1661804778094bf81feb-e471-da71-4a85-afaa15102c3a: [21308 b; 0 s]
16617989653936cd8d5b-577-d06-0eb6-530a36484f: [18450 b; 1661897901 s]
16617958157330023083-323d-b05-4fa-ceafcf8877a: [19503 b; 0 s]
16617967368695f11f3e-5374-eb36-81a8-7b4863a70e: [18145 b; 0 s]
166179439499317eada8-4135-aebb-240d-4c674fa4437: [17416 b; 0 s]
16617805893722258a-cefa-5ad-613-8d5c13cb2382: [18611 b; 0 s]
1661783924710ec0e0-a8d-bcc-e63b-ee6b511346fe: [18678 b; 0 s]
16617778789012b8f60-edad-2862-56b-13432f3f3006: [20568 b; 0 s]
166177660562687b1c1f-e6cd-6c1-b85f-88f0a1cdf8cc: [19504 b; 0 s]
1661694912637a27123-8ec0-06cf-c455-482b4827785: [17625 b; 0 s]
166164604103572f5f1e-2be-e3f-cbe-0b8ed860f6c: [18063 b; 0 s]
16616412917806c8c13-735d-6a-0fe3-0e6b5a6e757: [20211 b; 0 s]
1661607867132648c14-c81f-0d08-3bfc-b5f5085b22bf: [20815 b; 0 s]
16615334299968e2745d-28fa-02f4-d67c-e60aed303253: [20012 b; 1661636138 s]
1661521234900b022b5-8f30-5388-1e36-85a0ce82bf: [19969 b; 0 s]
166147240241488be808-d1be-6257-5fed-3ec0f86b50: [19364 b; 0 s]
1661462010741de8a53-8e3b-dda7-24a-ea265a047d75: [20021 b; 0 s]
166145798753622460c-cbfb-0cbb-7d20-2418bf4aa2: [17902 b; 1661555511 s]
1661451247573014735-053-d566-2b48-da0283c38b1f: [18096 b; 0 s]
1661438963023cc73032-b5c4-d4b2-7ab-b5f84e387c62: [21533 b; 1661538768 s]
1661385400263ab2653f-f26f-b56b-2184-187bc2afa4c6: [20783 b; 1661484856 s]
1661379543635b33a18-e83b-add8-df7-0ea2f543dfc1: [20711 b; 1661478300 s]
16613724005636faaff-0b3-dd73-b1ba-cff7ba5d38: [17463 b; 1661470333 s]
166136308150376e6aa-d1f3-52cb-017-6ec20f0c565e: [18015 b; 0 s]
1661357415182be572e6-6664-cd17-7b06-38ebcc1b5bec: [17322 b; 0 s]
166135527044704fc21-c826-a00f-0306-a7673b5ffd1: [20496 b; 1661455675 s]
16613533298094cebf5-67d-6daf-fedb-b0d7b885181: [19959 b; 1661450333 s]
16613451194501bf4cf-3b01-0-022-bbc65dde06: [21422 b; 0 s]
16613397789827c6fa45-424-6ca-d56c-d77a15160c7: [20690 b; 0 s]
166128027166837aeb7a-bb-0a22-1bdc-f1127b1bae77: [20683 b; 0 s]
16612807430558d31cc3-7b50-b402-770e-4db863adf8: [19836 b; 1661378749 s]
16612803353585f22db-4a0-ad82-f175-1d5e60dd1c42: [18528 b; 0 s]
166126819864648bde54-f5cf-5afa-ee7-d05e1e7827e: [19326 b; 0 s]
16612737532110c0141b-aec7-6cb1-53f-eb374da8bee0: [21540 b; 1661371536 s]
1661264884579317875-58d1-c168-c7e7-af37aded58f0: [17271 b; 0 s]
1661260177933c8f50e5-312f-3486-2e64-53bde82622e: [19718 b; 1661361237 s]
1661262852343cebba4e-b700-8a15-a783-627f5687547: [17588 b; 1661359960 s]
1661251640669cd5fe6d-b33-a2b3-140d-73223feec468: [20442 b; 0 s]
1661214893232af20adc-8a04-bc2f-d6a5-1f2b453cae5f: [17674 b; 0 s]
166117886844633bbe2-d4c8-322-0c58-dddeade746: [18266 b; 0 s]
166120045719270d004f-6a08-52ed-b144-cbbe7babdf1: [21429 b; 0 s]
1661170563985bad4011-e60f-c6f5-0e8c-7a5acc7c7650: [18332 b; 0 s]
1660949979481832a2f-4f45-7eda-0b1-f672b27b13: [19360 b; 0 s]
1661098312265f70a66-3f2f-4fc8-6d04-c76cbdc34e0: [17602 b; 0 s]
1661096392553515f8ea-f3bf-f20d-0b78-43233b6e5ef2: [19698 b; 1661193366 s]

memcached使用延迟到期机制,将已设置的显式到期时间与请求对象时的当前时间进行比较。只返回未过期的对象

参考:https://docs.oracle.com/cd/E17952_01/mysql-5.6-en/ha-memcached-using-expiry.html

相关内容

  • 没有找到相关文章

最新更新