On Thu, Mar 14, 2019 at 4:24 PM Nuwan Dias <[email protected]> wrote:

> Just thinking out loud, is there by any chance a possibility to run just 1
> forever for any number of policies? Even if that means a redesign of the
> policies?
>
Still, we don't know the logic behind the forever syntax. If it starts a
new thread with forever we can think a way to optimize the policies. Since
the policy file is not allowed to edit, we can include it to a single
ballerina file. But not sure it will affect the performance. Because when
it runs logic sequentially, it can introduce a delay to process the events.

>
> On Thu, Mar 14, 2019 at 3:48 PM Rajith Roshan <[email protected]> wrote:
>
>>
>>
>> On Thu, Mar 14, 2019 at 3:21 PM Nuwan Dias <[email protected]> wrote:
>>
>>>
>>>
>>> On Thu, Mar 14, 2019 at 3:20 PM Rajith Roshan <[email protected]> wrote:
>>>
>>>>
>>>>
>>>> On Thu, Mar 14, 2019 at 2:32 PM Nuwan Dias <[email protected]> wrote:
>>>>
>>>>> What about the developer first approach? In that case we pre load the
>>>>> default policies to the gateway anyway since there is no indication of an
>>>>> API being associated to a subs throttling policy.
>>>>>
>>>> I wonder in current implementation also how these subscription policies
>>>> are used. Since with developer first approach any way are not using oauth2
>>>> , I assume we are not using any of the subscription policies , @Arshardh
>>>> Ifthikar <[email protected]> please correct me if I am wrong
>>>>
>>>
>>> I believe we honor the tier that comes along with the JWT (if it does).
>>>
>> Yes,  For developer first approach we can ship the by default available
>> policies. In the other approach we can limit the policies we are adding to
>> micro gw. Because in APIM side there can be many subscription policies but
>> not used in APIs which is exposed via micro-gw
>>
>>>
>>>>> On Thu, Mar 14, 2019 at 2:23 PM Rajith Roshan <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi all,
>>>>>> Currently in microgateway(MGW) when we create the project directory
>>>>>> we fetch all the subscription and application policies and we generate 
>>>>>> the
>>>>>> source for each policy. In each policy there is ever running loop
>>>>>> (forever), in back ground to update the throttle counters. But the issue
>>>>>> some of the subscription policies(tiers) might not be used in any of the
>>>>>> APIS in MGW and these not used policies running in the background might 
>>>>>> be
>>>>>> consuming some CPU cycles
>>>>>>
>>>>>> So we thought of filter out the subscription policies(tiers) which
>>>>>> are attached to any of the APIs exposed via MGW.
>>>>>> For ex if API Foo is attach with policy 100PerMin and API Bar is
>>>>>> attached with policies 75PerMin and 50PerMin , then if we are only 
>>>>>> exposing
>>>>>> API "Foo" and "Bar" from MGW we will only create source files for those
>>>>>> subscription policies only, even though there are many subscription
>>>>>> policies defined in the admin portal of APIM.
>>>>>> Do you find any issues with this approach
>>>>>>
>>>>>> --
>>>>>> *Rajith Roshan* | Associate Technical Lead | WSO2 Inc.
>>>>>> (m) +94-717-064-214 |  (e) [email protected] <[email protected]>
>>>>>>
>>>>>> <https://wso2.com/signature>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Nuwan Dias* | Director | WSO2 Inc.
>>>>> (m) +94 777 775 729 | (e) [email protected]
>>>>> [image: Signature.jpg]
>>>>>
>>>>
>>>>
>>>> --
>>>> *Rajith Roshan* | Associate Technical Lead | WSO2 Inc.
>>>> (m) +94-717-064-214 |  (e) [email protected] <[email protected]>
>>>>
>>>> <https://wso2.com/signature>
>>>>
>>>
>>>
>>> --
>>> *Nuwan Dias* | Director | WSO2 Inc.
>>> (m) +94 777 775 729 | (e) [email protected]
>>> [image: Signature.jpg]
>>>
>>
>>
>> --
>> *Rajith Roshan* | Associate Technical Lead | WSO2 Inc.
>> (m) +94-717-064-214 |  (e) [email protected] <[email protected]>
>>
>> <https://wso2.com/signature>
>>
>
>
> --
> *Nuwan Dias* | Director | WSO2 Inc.
> (m) +94 777 775 729 | (e) [email protected]
> [image: Signature.jpg]
>


-- 
Rukshan Chathuranga.
WSO2, Inc.
+94711822074
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to