{"action":"created","issue":{"url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/13","repository_url":"https://api.github.com/repos/sobotklp/django-throttle-requests","labels_url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/13/comments","events_url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/13/events","html_url":"https://github.com/sobotklp/django-throttle-requests/issues/13","id":143950510,"number":13,"title":"BUCKET_INTERVAL is half of what's set in settings.py","user":{"login":"mhb11","id":12384553,"avatar_url":"https://avatars.githubusercontent.com/u/12384553?v=3","gravatar_id":"","url":"https://api.github.com/users/mhb11","html_url":"https://github.com/mhb11","followers_url":"https://api.github.com/users/mhb11/followers","following_url":"https://api.github.com/users/mhb11/following{/other_user}","gists_url":"https://api.github.com/users/mhb11/gists{/gist_id}","starred_url":"https://api.github.com/users/mhb11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhb11/subscriptions","organizations_url":"https://api.github.com/users/mhb11/orgs","repos_url":"https://api.github.com/users/mhb11/repos","events_url":"https://api.github.com/users/mhb11/events{/privacy}","received_events_url":"https://api.github.com/users/mhb11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-28T10:56:55Z","updated_at":"2016-04-26T07:29:31Z","closed_at":null,"body":"@sobotklp I'm testing the following:\r\n```\r\n\r\nTHROTTLE_ZONES = {\r\n    'default': {\r\n        'VARY':'throttle.zones.RemoteIP',\r\n        'NUM_BUCKETS':2,  # Number of buckets worth of history to keep. Must be at least 2\r\n        'BUCKET_INTERVAL':10,  # Period of time to enforce limits.\r\n        'BUCKET_CAPACITY':2,  # Maximum number of requests allowed within BUCKET_INTERVAL\r\n    },\r\n}\r\n```\r\n\r\nThe above allows me 2 requests in every 5 seconds instead of 10. Have you seen this behavior too?"},"comment":{"url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/comments/214653390","html_url":"https://github.com/sobotklp/django-throttle-requests/issues/13#issuecomment-214653390","issue_url":"https://api.github.com/repos/sobotklp/django-throttle-requests/issues/13","id":214653390,"user":{"login":"sobotklp","id":794666,"avatar_url":"https://avatars.githubusercontent.com/u/794666?v=3","gravatar_id":"","url":"https://api.github.com/users/sobotklp","html_url":"https://github.com/sobotklp","followers_url":"https://api.github.com/users/sobotklp/followers","following_url":"https://api.github.com/users/sobotklp/following{/other_user}","gists_url":"https://api.github.com/users/sobotklp/gists{/gist_id}","starred_url":"https://api.github.com/users/sobotklp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sobotklp/subscriptions","organizations_url":"https://api.github.com/users/sobotklp/orgs","repos_url":"https://api.github.com/users/sobotklp/repos","events_url":"https://api.github.com/users/sobotklp/events{/privacy}","received_events_url":"https://api.github.com/users/sobotklp/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T07:29:31Z","updated_at":"2016-04-26T07:29:31Z","body":"Hi there, sorry for the incredibly delated response.\r\n\r\nDo you see that behaviour all the time? technically it is possible to see that if you're testing manually and your 3rd request enters the next 10-second span.\r\n\r\n`\r\n----------------------------------------------\r\n-         10 sec     |         10 sec     -\r\n----------------------------------------------\r\n`\r\n\r\nFor example, if your first two requests occurred into the first 10-second span above, and the 3rd, 4th and 5th requests occurred in the second span, you would see the behaviour you saw.\r\n\r\nThe bucket to assign the request is computed by `(time.time() % BUCKET_INTERVAL*NUM_BUCKETS) / BUCKET_INTERVAL`"}}