{"action":"created","issue":{"url":"https://api.github.com/repos/3scale/apicast/issues/648","repository_url":"https://api.github.com/repos/3scale/apicast","labels_url":"https://api.github.com/repos/3scale/apicast/issues/648/labels{/name}","comments_url":"https://api.github.com/repos/3scale/apicast/issues/648/comments","events_url":"https://api.github.com/repos/3scale/apicast/issues/648/events","html_url":"https://github.com/3scale/apicast/pull/648","id":303403290,"number":648,"title":"Add rate limiting to the entire service policy.","user":{"login":"y-tabata","id":34849594,"avatar_url":"https://avatars2.githubusercontent.com/u/34849594?v=4","gravatar_id":"","url":"https://api.github.com/users/y-tabata","html_url":"https://github.com/y-tabata","followers_url":"https://api.github.com/users/y-tabata/followers","following_url":"https://api.github.com/users/y-tabata/following{/other_user}","gists_url":"https://api.github.com/users/y-tabata/gists{/gist_id}","starred_url":"https://api.github.com/users/y-tabata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-tabata/subscriptions","organizations_url":"https://api.github.com/users/y-tabata/orgs","repos_url":"https://api.github.com/users/y-tabata/repos","events_url":"https://api.github.com/users/y-tabata/events{/privacy}","received_events_url":"https://api.github.com/users/y-tabata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-08T09:00:40Z","updated_at":"2018-03-08T11:46:12Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/3scale/apicast/pulls/648","html_url":"https://github.com/3scale/apicast/pull/648","diff_url":"https://github.com/3scale/apicast/pull/648.diff","patch_url":"https://github.com/3scale/apicast/pull/648.patch"},"body":"Hi team,\r\n\r\nI created a new policy that adds rate limiting to the entire Service.\r\nThe RFE about this has been opened [1].\r\n\r\n[1] https://access.redhat.com/solutions/3308541"},"comment":{"url":"https://api.github.com/repos/3scale/apicast/issues/comments/371464597","html_url":"https://github.com/3scale/apicast/pull/648#issuecomment-371464597","issue_url":"https://api.github.com/repos/3scale/apicast/issues/648","id":371464597,"user":{"login":"kevprice83","id":12881207,"avatar_url":"https://avatars1.githubusercontent.com/u/12881207?v=4","gravatar_id":"","url":"https://api.github.com/users/kevprice83","html_url":"https://github.com/kevprice83","followers_url":"https://api.github.com/users/kevprice83/followers","following_url":"https://api.github.com/users/kevprice83/following{/other_user}","gists_url":"https://api.github.com/users/kevprice83/gists{/gist_id}","starred_url":"https://api.github.com/users/kevprice83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevprice83/subscriptions","organizations_url":"https://api.github.com/users/kevprice83/orgs","repos_url":"https://api.github.com/users/kevprice83/repos","events_url":"https://api.github.com/users/kevprice83/events{/privacy}","received_events_url":"https://api.github.com/users/kevprice83/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T11:46:12Z","updated_at":"2018-03-08T11:46:12Z","author_association":"CONTRIBUTOR","body":"@y-tabata thanks for the contribution. However, it would make more sense to use the [lua-resty-limit-traffic module](https://github.com/openresty/lua-resty-limit-traffic) to implement the rate limiting here. This will allow you to create true periods using the [count module](https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/limit/count.md). The limits can be defined using the [traffic module](https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/limit/traffic.md).\r\n\r\nYou can combine the **traffic module** with the [request module](https://github.com/openresty/lua-resty-limit-traffic/blob/master/lib/resty/limit/traffic.md) to utilise the _\"leaky bucket\"_ method to rate limit requests.\r\n\r\nThe idea overall should be to wrap the redis instance so that it is a shared cache and opt in, the local `dict` can be used if not redis. You can see a proof of concept [here](https://github.com/3scale/conn-limiter/commit/2210dccf9370bfe2a6bbdf3f8030ec21ed951c74). The shared redis memory would be written into the API shown [here](https://github.com/openresty/lua-nginx-module#ngxshareddict). The default should be the `shdict` and Redis used if configured.\r\n\r\nThe final policy should be easily extensible for future contributions.\r\n\r\ncc @mikz if you want to add anything to my comments here.\r\n"}}
{"actor":{"display_login":"kevprice83"}}