I just want to follow up. If quota's windows is behaved like my test(I could
sent to 16 recipients in 5 minutes with a quota limit at 8 recipients), I
know this far-fetched in real environment.  How hard is to tweet the formula
to block at exactly or close to the quota limit.  Any suggestions?

On Mon, Dec 13, 2010 at 2:53 PM, dingni <[email protected]> wrote:

> I'm running stable cluebringer-2.0.10.
>
> On Mon, Dec 13, 2010 at 2:34 PM, Nigel Kukard <[email protected]> wrote:
>
>>  On 12/13/10 22:11, dingni wrote:
>>
>> Thanks for the explanation. So I went back dig though mail list and come
>> back with this relative topics:
>> http://lists.policyd.org/pipermail/users/2009-October/002827.html
>> http://lists.policyd.org/pipermail/users/2010-May/003033.html
>> http://lists.policyd.org/pipermail/users/2010-January/002905.html
>>
>>
>> If the windows is dynamic, then I could send double the total of quota
>> limit.
>>
>> Example:
>>
>> Period: 300s(5 minutes), quota limit 8(which means block at 10th
>> recipients)
>>
>> Dec 13 13:26:15  mailman cbpolicyd[2234]: module=Quotas, mode=update,
>> host=192.168.0238, helo=kkkkk, [email protected], to=
>> [email protected] reason=quota_update, policy=10, quota=7, limit=8,
>> track=Sender:[email protected] <sender%[email protected]>,
>> counter=MessageCount, quota=*1/8* (12.5%)
>> Dec 13 13:26:16  ... quota=2/8 (24.2%)
>> Dec 13 13:26:17  ... quota=3/8 (35.2%)
>> Dec 13 13:26:19 ... quota=4/8 (47.2%)
>> Dec 13 13:26:20  ... quota=5/8 (59.4%)
>> Dec 13 13:26:21  ... quota=6/8 (71.3%)
>> Dec 13 13:26:22  ... quota=7/8 (86.6%)
>> Dec 13 13:26:22  ... quota=8/8 (98.8%)
>>
>> Waited( look below at *formula 1)*
>>
>> Dec 13 13:29:57 ... quota=*3/8* (40.5%)
>> Dec 13 13:30:32 ... quota=4/8 (48.3%)
>> Dec 13 13:30:33 ... quota=5/8 (60.6%)
>> Dec 13 13:30:34  ... quota=6/8 (72.9%)
>> Dec 13 13:30:35 ... quota=7/8 (85.2%)
>> Dec 13 13:30:36 ... quota=8/8 (97.4%)
>> Dec 13 13:30:37 ... quota=9/8 (109.6%)
>>
>> waited
>> Dec 13 13:31:10 .. quota=9/8 (110.0%)
>> Dec 13 13:31:11 Dec 13 13:31:11 mailman cbpolicyd[12995]: module=Quotas,
>> action=*reject* quota=*10/8* (122.1%)
>> Dec 13 13:31:11
>>
>>
>> I'd like to see full debug logs with this running on RC1 + the patch
>> Robert Anderson posted, as this is just not possible in the code path.
>>
>> # Quotas.pm - Line 191
>>                                 if ($currentCounter >
>> $limit->{'CounterLimit'}) {
>>                                     $hasExceeded = "Policy rejection;
>> Message count quota exceeded";
>>
>>
>>
>>
>> *formula 1:*
>> http://lists.policyd.org/pipermail/users/2010-January/002905.html
>> Delta = (1 - (Now - LastUpdate) / Period)  * LastCount + 1
>>            = (1-(13:29:57 - 13:26:22)/300) * 8 + 1
>>            = 3.26
>> 3.26 rounds down to 3
>>
>> So, in total, I was able to send 16 messages(recipients).
>>
>> My intention is to limit a client to send 100 emails(recipients) a day.
>>
>>
>> Very many changes have taken place since 2009 and now. For the full
>> mathematical calculation on how the values are worked out one would need to
>> reference the code.
>>
>> The exact calculation is ... (as far as I can see at 00:30 in the
>> evening).
>>
>> (Simon, for your reference too. Robert, please add this to the site for
>> future reference)
>>
>> 1. Counter = DBValue
>> 2. ElapsedTime = Now - LastUpdate
>> 3. IF ElaposedTime > Period THEN CurrentCounter = 0 ELSE CurrentCounter =
>> ( 1 - (ElapsedTime / Period) ) * Counter
>> 4. Delta = CurrentCounter - Counter
>> 5. CurrentCounter++
>> 6. IF CurrentCounter > Limit THEN <action>
>> 7. DBValue += Delta (+1)
>>
>> So ...
>> Counter = 8
>> ElapsedTime = 13:29:57 - 13:26:22 = 215
>> CurrentCounter = ( 1 - (215 / 300) ) * 8 = 2.27
>> Delta = 2.27 - 8 = -5.73
>>  * * allow mail .... CurrentCounter (+1) < Limit * *
>> DBValue += -5.73 (+1) = 3.27
>>
>>
>> Are you using the latest RC1 with the patch that Robert Anderson posted?
>>
>> -N
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> [email protected]
>> http://lists.policyd.org/mailman/listinfo/users
>>
>>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to