{"action":"created","issue":{"url":"https://api.github.com/repos/unbit/uwsgi/issues/1168","labels_url":"https://api.github.com/repos/unbit/uwsgi/issues/1168/labels{/name}","comments_url":"https://api.github.com/repos/unbit/uwsgi/issues/1168/comments","events_url":"https://api.github.com/repos/unbit/uwsgi/issues/1168/events","html_url":"https://github.com/unbit/uwsgi/issues/1168","id":129080155,"number":1168,"title":"cache reporting as full but it isn't according to metrics","user":{"login":"goir","id":586209,"avatar_url":"https://avatars.githubusercontent.com/u/586209?v=3","gravatar_id":"","url":"https://api.github.com/users/goir","html_url":"https://github.com/goir","followers_url":"https://api.github.com/users/goir/followers","following_url":"https://api.github.com/users/goir/following{/other_user}","gists_url":"https://api.github.com/users/goir/gists{/gist_id}","starred_url":"https://api.github.com/users/goir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goir/subscriptions","organizations_url":"https://api.github.com/users/goir/orgs","repos_url":"https://api.github.com/users/goir/repos","events_url":"https://api.github.com/users/goir/events{/privacy}","received_events_url":"https://api.github.com/users/goir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-27T09:16:06Z","updated_at":"2016-01-29T08:39:27Z","closed_at":null,"body":"Hi,\r\n\r\nwe're having some problems with full caches. The uwsgi log states they are full but clearly aren't according to uwsgicachetop and the raw metrics.\r\n\r\n\t{\r\n\t\t\"name\":\"XXXX\",\r\n\t\t\"hash\":\"djb33x\",\r\n\t\t\"hashsize\":65536,\r\n\t\t\"keysize\":57,\r\n\t\t\"max_items\":30000,\r\n\t\t\"blocks\":30000,\r\n\t\t\"blocksize\":5,\r\n\t\t\"items\":24139,\r\n\t\t\"hits\":338199,\r\n\t\t\"miss\":26053,\r\n\t\t\"full\":25964,\r\n\t\t\"last_modified_at\":0\r\n\t},\r\n`cache2 = name=XXXX,items=30000,keysize=57,blocksize=5,store_delete=1,store=%(cache_dir)/XXXX,ignore_full=1,purge_lru=1`\r\n\r\nfrom the startup log:\r\n*** Cache \"XXXX\" initialized: 4MB (key: 145 bytes, keys: 4350000 bytes, data: 150000 bytes, bitmap: 0 bytes) preallocated ***\r\n\r\nthis one is configured as lru cache but it should use the full 30k items. This also happens when not using lru. One the cache is full the item number does not change at all, it always stays at 24139. Items in this cache have a TTL of 1800 seconds.\r\n\r\nIf i do a reload of the app the number of items changes: `\"items\":24181`, `\"items\":24171`. But the cache is instantly full and the number does not change.\r\n\r\nWe've had another cache which said it was full at 64k items but is configured for 300k items. I've deleted the store file and restarted the app. It went over 100k items without being full again. This happened a few times now and it will again.\r\nI think this has something to do with the store files which might get corrupted or something over time. Maybe restarting while the files are written ?\r\n\r\nIs there a way to analyze the store file if this happens again or any other idea how to find what the issue is ?\r\n\r\nuwsgi version: 2.0.12\r\n\r\nThanks\r\nGoir"},"comment":{"url":"https://api.github.com/repos/unbit/uwsgi/issues/comments/176642273","html_url":"https://github.com/unbit/uwsgi/issues/1168#issuecomment-176642273","issue_url":"https://api.github.com/repos/unbit/uwsgi/issues/1168","id":176642273,"user":{"login":"goir","id":586209,"avatar_url":"https://avatars.githubusercontent.com/u/586209?v=3","gravatar_id":"","url":"https://api.github.com/users/goir","html_url":"https://github.com/goir","followers_url":"https://api.github.com/users/goir/followers","following_url":"https://api.github.com/users/goir/following{/other_user}","gists_url":"https://api.github.com/users/goir/gists{/gist_id}","starred_url":"https://api.github.com/users/goir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goir/subscriptions","organizations_url":"https://api.github.com/users/goir/orgs","repos_url":"https://api.github.com/users/goir/repos","events_url":"https://api.github.com/users/goir/events{/privacy}","received_events_url":"https://api.github.com/users/goir/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T08:39:27Z","updated_at":"2016-01-29T08:39:27Z","body":"`lazy` should not be used anymore, i've activated `lazy-apps` now. We'll see how it goes over the day.\r\nBut this is expected behaviour when using master = 1 ? This should be documented somewhere since the cache items do not expire and might return outdated results in this situation."}}