{"action":"created","issue":{"url":"https://api.github.com/repos/Mashape/kong/issues/205","labels_url":"https://api.github.com/repos/Mashape/kong/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/Mashape/kong/issues/205/comments","events_url":"https://api.github.com/repos/Mashape/kong/issues/205/events","html_url":"https://github.com/Mashape/kong/issues/205","id":73932912,"number":205,"title":"[request] Multiple ratelimiting options per API","user":{"login":"tamizhgeek","id":135621,"avatar_url":"https://avatars.githubusercontent.com/u/135621?v=3","gravatar_id":"","url":"https://api.github.com/users/tamizhgeek","html_url":"https://github.com/tamizhgeek","followers_url":"https://api.github.com/users/tamizhgeek/followers","following_url":"https://api.github.com/users/tamizhgeek/following{/other_user}","gists_url":"https://api.github.com/users/tamizhgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/tamizhgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamizhgeek/subscriptions","organizations_url":"https://api.github.com/users/tamizhgeek/orgs","repos_url":"https://api.github.com/users/tamizhgeek/repos","events_url":"https://api.github.com/users/tamizhgeek/events{/privacy}","received_events_url":"https://api.github.com/users/tamizhgeek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mashape/kong/labels/plugins","name":"plugins","color":"bfdadc"},{"url":"https://api.github.com/repos/Mashape/kong/labels/request","name":"request","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-07T10:26:27Z","updated_at":"2015-05-08T11:24:16Z","closed_at":null,"body":"Here is our usecase: \r\n\r\nFor an API, we impose a monthly limit of 100,000 calls. Also there is a second level throttling of 5 requests/second to avoid too many concurrent requests. Currently, this is not possible with kong. \r\n\r\nI think we can allow to have multiple rate limits per API provided they have different period values. And while throttling the requests, we can verify all of them and throw a 429 even if any one has crossed the quota. I would like a send a PR to fix this. But, before I would like to have the feedback. \r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/Mashape/kong/issues/comments/100198596","html_url":"https://github.com/Mashape/kong/issues/205#issuecomment-100198596","issue_url":"https://api.github.com/repos/Mashape/kong/issues/205","id":100198596,"user":{"login":"tamizhgeek","id":135621,"avatar_url":"https://avatars.githubusercontent.com/u/135621?v=3","gravatar_id":"","url":"https://api.github.com/users/tamizhgeek","html_url":"https://github.com/tamizhgeek","followers_url":"https://api.github.com/users/tamizhgeek/followers","following_url":"https://api.github.com/users/tamizhgeek/following{/other_user}","gists_url":"https://api.github.com/users/tamizhgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/tamizhgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamizhgeek/subscriptions","organizations_url":"https://api.github.com/users/tamizhgeek/orgs","repos_url":"https://api.github.com/users/tamizhgeek/repos","events_url":"https://api.github.com/users/tamizhgeek/events{/privacy}","received_events_url":"https://api.github.com/users/tamizhgeek/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T11:24:16Z","updated_at":"2015-05-08T11:24:16Z","body":"Thanks for the :+1: \r\n\r\nCurrently the rate limiting config is like:\r\n\r\n--data \"value.limit=100\" and --data \"value.period=hour\"\r\n\r\nThere are two ways I can think of supporting multiple configurations. \r\n1. --data \"value.limits=5,1000\" and --data \"value.periods=second,hour\" (Having limit and periods as separate options and rely on the order supplied by the user to match them). \r\n2. --data \"value.limits=5:second, 1000:hour\" (Much cleaner, but removing a existing option from API)\r\n\r\nwhich one do you guys prefer? "}}