{"action":"created","issue":{"url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/31","labels_url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/31/comments","events_url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/31/events","html_url":"https://github.com/alisaifee/flask-limiter/issues/31","id":91037825,"number":31,"title":"Memcached backed limiter produces unexpected results running multi-machine","user":{"login":"zacharyozer","id":1268023,"avatar_url":"https://avatars.githubusercontent.com/u/1268023?v=3","gravatar_id":"","url":"https://api.github.com/users/zacharyozer","html_url":"https://github.com/zacharyozer","followers_url":"https://api.github.com/users/zacharyozer/followers","following_url":"https://api.github.com/users/zacharyozer/following{/other_user}","gists_url":"https://api.github.com/users/zacharyozer/gists{/gist_id}","starred_url":"https://api.github.com/users/zacharyozer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacharyozer/subscriptions","organizations_url":"https://api.github.com/users/zacharyozer/orgs","repos_url":"https://api.github.com/users/zacharyozer/repos","events_url":"https://api.github.com/users/zacharyozer/events{/privacy}","received_events_url":"https://api.github.com/users/zacharyozer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-25T18:15:40Z","updated_at":"2015-06-30T12:11:52Z","closed_at":null,"body":"Hi,\r\n\r\nWe're seeing some very strange behavior when running flask-limiter in the following environment (backed by memcache):\r\n\r\n![compass architechture](https://cloud.githubusercontent.com/assets/1268023/8361963/16e899ee-1b44-11e5-8bab-a782e460c0bf.png)\r\n\r\nWith a limit of 30 requests per minute, I see the following when printing out the flask-limiter debug headers:\r\n```\r\niteration: 0, remaining 29, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 1, remaining 29, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 2, remaining 28, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 3, remaining 27, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 4, remaining 26, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 5, remaining 25, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 6, remaining 24, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 7, remaining 28, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 8, remaining 29, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 9, remaining 23, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 10, remaining 27, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 11, remaining 26, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 12, remaining 22, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 13, remaining 21, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 14, remaining 20, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 15, remaining 19, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 16, remaining 28, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 17, remaining 27, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 18, remaining 26, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 19, remaining 18, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 20, remaining 17, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 21, remaining 16, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 22, remaining 15, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 23, remaining 14, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 24, remaining 25, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 25, remaining 25, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 26, remaining 24, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 27, remaining 23, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 28, remaining 13, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 29, remaining 12, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 30, remaining 22, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 31, remaining 24, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 32, remaining 11, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 33, remaining 21, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 34, remaining 20, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 35, remaining 10, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 36, remaining 9, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 37, remaining 19, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 38, remaining 8, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 39, remaining 7, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 40, remaining 18, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256060'}\r\niteration: 41, remaining 6, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 42, remaining 5, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256061'}\r\niteration: 43, remaining 29, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256120'}\r\niteration: 44, remaining 28, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256120'}\r\niteration: 45, remaining 23, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 46, remaining 27, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256120'}\r\niteration: 47, remaining 22, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 48, remaining 21, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256072'}\r\niteration: 49, remaining 29, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256128'}\r\niteration: 50, remaining 26, headers {'x-ratelimit-limit': '30', 'x-ratelimit-reset': '1435256120'}\r\n```\r\nAny idea what might be causing this?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/comments/117155302","html_url":"https://github.com/alisaifee/flask-limiter/issues/31#issuecomment-117155302","issue_url":"https://api.github.com/repos/alisaifee/flask-limiter/issues/31","id":117155302,"user":{"login":"zacharyozer","id":1268023,"avatar_url":"https://avatars.githubusercontent.com/u/1268023?v=3","gravatar_id":"","url":"https://api.github.com/users/zacharyozer","html_url":"https://github.com/zacharyozer","followers_url":"https://api.github.com/users/zacharyozer/followers","following_url":"https://api.github.com/users/zacharyozer/following{/other_user}","gists_url":"https://api.github.com/users/zacharyozer/gists{/gist_id}","starred_url":"https://api.github.com/users/zacharyozer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zacharyozer/subscriptions","organizations_url":"https://api.github.com/users/zacharyozer/orgs","repos_url":"https://api.github.com/users/zacharyozer/repos","events_url":"https://api.github.com/users/zacharyozer/events{/privacy}","received_events_url":"https://api.github.com/users/zacharyozer/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T12:11:52Z","updated_at":"2015-06-30T12:11:52Z","body":"We're using the fixed window strategy. Still waiting to hear back from AWS, so we're going to move to a single AZ cache temporarily. Will let you know if this resolves the issue."}}