sqlcounter returning wrong value?

liran tal liransgarage at gmail.com
Sat Nov 8 23:46:19 CET 2008


Hey Venkatesh,

On Fri, Oct 31, 2008 at 2:26 AM, Venkatesh K <kaevee at gmail.com> wrote:

> 2008/10/31  <tnt at kalik.net>:
> > It does make sense. rlm_sqlcounterworks like this toward the time of the
> > reset: lets say you have an hour left, your limit is 20 hours and you
> > have signed in 15 minutes before counter reset time.  When code
> > calculates that you can be online at reset time it doesn't return your
> > allowance (1 hour) but adds the limit for the next conting period (20
> > hours) to the remaining time (15 minutes) and returns that value (20
> > hours and 15 minutes). Reasoning is that your session shouldn't be
> > discontinued after an hour becouse 15 minutes into the session new limit
> > should come into force (and session limit can't be changed during the
> > session).
> >
> > In your case there is about 2,000,000 left on the counter but only a few
> > thousand seconds left to the end of the reset period, so code will add
> > those few thousands to the next period limit (26,000,000) and return
> > that value. Code doesn't "know" are you counting data or time as
> > there is  no such configuration item.
> >
> > Venkatesh had posted the patch that switches off this peace of code for
> > data counters by introducing that configuration item. You should try it.
>
> rlm_sqlcounter has one more limitation. In version 1.1.7, the maximum
> counter value was limited to <2G whereas in 2.1.1 it seems to be <4G.
> This imposes an artificial limitation of maximum of 4GB of downloads.
> I had a workaround where I patched rlm_sqlcounter to limit the per
> session downloads to 4GB if allowed usage exceeds 4GB.
>
> Except this issue, I think, with the patch I posted earlier, one
> should be fine with rlm_sqlcounter. If someone needs a patch to work
> around the 2GB/4GB limit, I will post the patch.
>

Sorry for the late reply.
I applied your patch and now data counters work as expected with a minor
exception, the 2Gb limit
as you have stated previously. Possibly you could also post the patch for
the 2Gb/4Gb limit?
I'm hoping it's compatible with FR 1.1.7 as well.

Thanks,
Liran.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20081109/baf4dec4/attachment.html>


More information about the Freeradius-Users mailing list