[OpenSIPS-Users] ratelimit per method per subscriber

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Nov 16 15:06:00 CET 2009


Hi Jeff,

you are right...it is a bit complicated ...based on $Ts (timestamp) you 
could reset from time to time the counter, so that we can get values for 
particular time intervals. (like if $Ts modulo 10 is zero, reset it -> 
20 secs intervals).  Just an idea....

Regards,
Bogdan

Jeff Pyle wrote:
> Hi Bogdan,
>
> I understand the part about using memcache for keeping count, but I don't
> understand how I can handle the temporal aspect of rate-limiting.  For
> example, I can could invites, but I don't know how to count invites per
> second, handle bursting, etc.  Any pointers?
>
>
> Regards,
> Jeff
>
>
>
> On 11/15/09 3:04 PM, "Bogdan-Andrei Iancu" <bogdan at voice-system.ro> wrote:
>
>   
>> Hi Jeff,
>>
>> Maybe you can use the memcache support (with variable names) to keep the
>> information you need for counting and limiting traffic based on whatever
>> you want.
>>
>> So, using variables in cache, you can implement (directly in script)
>> some custom limiting alg.
>>
>> Regards,
>> Bogdan
>>
>> Jeff Pyle wrote:
>>     
>>> Ovidiu,
>>>
>>> I'd like to be able to impose a limit on each of my subscribers.  I could
>>> have thousands of subscribers.  Apparently this module isn't appropriate for
>>> that kind of application.
>>>
>>>
>>> - Jeff
>>>
>>>
>>> On 11/9/09 12:28 PM, "Ovidiu Sas" <osas at voipembedded.com> wrote:
>>>
>>>   
>>>       
>>>> Hello Jeff,
>>>>
>>>> Since you want to limit only the INVITEs, just go with the forced
>>>> limiting by forcing a known pipe:
>>>> http://www.opensips.org/html/docs/modules/devel/ratelimit.html#id228413
>>>> Define a pipe for each IP and the map the IP to a pipe before ratelimiting.
>>>> The only thing that you need to be aware are the maximum number of pipes:
>>>> http://www.opensips.org/html/docs/modules/devel/ratelimit.html#id271306
>>>> If you need more then 16 pipes, you will need to recompile.
>>>>
>>>> Hope this helps.
>>>> Regards,
>>>> Ovidiu Sas
>>>>
>>>> On Mon, Nov 9, 2009 at 11:31 AM, Jeff Pyle <jpyle at fidelityvoice.com> wrote:
>>>>     
>>>>         
>>>>> Hello,
>>>>>
>>>>> It appears our options today for limiting traffic quantity into Opensips
>>>>> are
>>>>> the pike and ratelimit modules.  As my oversimplified minds understand it,
>>>>> pike works by limiting all traffic based on source IP.  Ratelimit works by
>>>>> limiting all traffic based on method.
>>>>>
>>>>> Is there a way with ratelimit to limit traffic based on method per source
>>>>> IP?  For example, can I specify a usr_preference that indicates calls
>>>>> (INVITEs) per second per subscriber?
>>>>>
>>>>> I've got a functioning ratelimit configuration to limit the amount of
>>>>> INVITEs into the proxy based on the example configurations but I don't see
>>>>> how to do it based on subscriber/source IP like pike does.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Jeff
>>>>>
>>>>>           

-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list