Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-03 Thread Alan DeKok
Arran Cudbard-Bell wrote:
> This is pretty much a none issue. Just have the detail file writer start
> a new file every minute/hour, then the number of repeated entries is
> very small. It's only when you have it start a new file every day, or
> use one monolithic detail file that you run into problems.

  Having hourly detail files is recommended, and does help.  But for
sites doing 100 acct/s, that means having ~300K packets in the file.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-03 Thread ramesh p
> this means that slow SQL system will kill your AAA capabilities

> - hence detail file, buffered-sql etc
Am doing only accounting.

Kindly clarify: fre
Is Buffered_SQL is single threaded module? and does not make use of
available mysql threads to complete the job in parallel?

Hi,
> I deactivated buffered-sql and logging directly to mysql by deafult
module.
> Just one basic question :

this means that slow SQL system will kill your AAA capabilities

- hence detail file, buffered-sql etc

alan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread Arran Cudbard-Bell
Alan DeKok wrote:
> Ivan Kalik wrote:
>   
>> Counter? Write detail.work.counter onto the disk, increment it every time
>> packet is processed and return to zero when detail.work is deleted. It
>> will say how many packets to skip when radiusd is restarted.
>> 
>
>   Hmm... OK.  Or slightly differently: the offset in the file of where
> it last read a packet.
>
>   
Yep that's a good option.
>   Maybe for 2.1.8.
>
>   
This is pretty much a none issue. Just have the detail file writer start
a new file every minute/hour, then the number of repeated entries is
very small. It's only when you have it start a new file every day, or
use one monolithic detail file that you run into problems.

-Arran



signature.asc
Description: OpenPGP digital signature
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread Alan DeKok
ramesh p wrote:
> If the db freezes. When db comes up, radius starting filling data to db.
> But the current packets are logged after 2 days, which our reporting
> will be effected. And it's starting filling the entire detail.work
> file(updating the old packets in db).
> Is the detial.work file fix is in FR dev roadmap?

  Eventually.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread Ivan Kalik
> If the db freezes. When db comes up, radius starting filling data to db.
> But
> the current packets are logged after 2 days, which our reporting will be
> effected.

How is database breakdown freeradius fault??? And what were you doing
those two days if you haven't noticed that new packets aren't written into
the database?

> And it's starting filling the entire detail.work file(updating
> the
> old packets in db).
> Is the detial.work file fix is in FR dev roadmap?

Could be in 2.1.8.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread ramesh p
If the db freezes. When db comes up, radius starting filling data to db. But
the current packets are logged after 2 days, which our reporting will be
effected. And it's starting filling the entire detail.work file(updating the
old packets in db).
Is the detial.work file fix is in FR dev roadmap?

ramesh p wrote:
> db frozen in my production env. This issue has been seen. Exeperiencing
> Outages in prod. environment. Please suggest a fix to overcome this issue.

  Outages?  If the DB is down, the server should still write to the
detail file.  When the DB comes back up, it will read from the detail
file, and write to the DB.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread Alan DeKok
Ivan Kalik wrote:
> Counter? Write detail.work.counter onto the disk, increment it every time
> packet is processed and return to zero when detail.work is deleted. It
> will say how many packets to skip when radiusd is restarted.

  Hmm... OK.  Or slightly differently: the offset in the file of where
it last read a packet.

  Maybe for 2.1.8.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread Alan DeKok
ramesh p wrote:
> db frozen in my production env. This issue has been seen. Exeperiencing
> Outages in prod. environment. Please suggest a fix to overcome this issue.

  Outages?  If the DB is down, the server should still write to the
detail file.  When the DB comes back up, it will read from the detail
file, and write to the DB.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-02 Thread ramesh p
db frozen in my production env. This issue has been seen. Exeperiencing
Outages in prod. environment. Please suggest a fix to overcome this issue.

> Alan Buxey wrote:
>>>   Hmmm... maybe over-writing it with spaces would work... or something
>>> else might go wrong.
>>
>> or reverse it when making the .work copy and read from the end of the
>> file
>
>   That's hard... the detail.work file is created via a "rename", which
> is nearly zero cost.
>
>   Alan DeKok.

Counter? Write detail.work.counter onto the disk, increment it every time
packet is processed and return to zero when detail.work is deleted. It
will say how many packets to skip when radiusd is restarted.

Ivan Kalik
Kalik Informatika ISP
-
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Ivan Kalik
> Alan Buxey wrote:
>>>   Hmmm... maybe over-writing it with spaces would work... or something
>>> else might go wrong.
>>
>> or reverse it when making the .work copy and read from the end of the
>> file
>
>   That's hard... the detail.work file is created via a "rename", which
> is nearly zero cost.
>
>   Alan DeKok.

Counter? Write detail.work.counter onto the disk, increment it every time
packet is processed and return to zero when detail.work is deleted. It
will say how many packets to skip when radiusd is restarted.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan DeKok
Alan Buxey wrote:
>>   Hmmm... maybe over-writing it with spaces would work... or something
>> else might go wrong.
> 
> or reverse it when making the .work copy and read from the end of the file

  That's hard... the detail.work file is created via a "rename", which
is nearly zero cost.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan Buxey
Hi,

>   File *truncation* is supported in POSIX.  But truncating from the
> start of the file isn't in POSIX.

ah yes. been a while.


>   Hmmm... maybe over-writing it with spaces would work... or something
> else might go wrong.

or reverse it when making the .work copy and read from the end of the file

alan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan DeKok
Alan Buxey wrote:
>>   It would need to (somehow) mark each record in the detail file as
>> "handled".  Ideally, without breaking the existing format, OR using any
>> extra bytes on the disk.
> 
> can it not throw away the data from the detail.work as it completes it? 

  Er... how?  It's a text file on the disk.  There's no way of saying
"re-set the start of the file to be 10K ahead of where it is now".

  File *truncation* is supported in POSIX.  But truncating from the
start of the file isn't in POSIX.

  Hmmm... maybe over-writing it with spaces would work... or something
else might go wrong.

  But really, if it's going to be tweaked, it should probably be
redesigned from the ground up.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan Buxey
Hi,

>   It would need to (somehow) mark each record in the detail file as
> "handled".  Ideally, without breaking the existing format, OR using any
> extra bytes on the disk.

can it not throw away the data from the detail.work as it completes it? 

alan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan DeKok
Alan Buxey wrote:
> as it currently stands, if you quit then it'll start reading
> the detail.work from the very beginning - there is no tail/stripping or
> checkpointing of the file.  it'd be good for such feature to be added
> at some point (i dont have time to dig/fix it)

  It would need to (somehow) mark each record in the detail file as
"handled".  Ideally, without breaking the existing format, OR using any
extra bytes on the disk.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Ivan Kalik
> I calculated it correctly in dialup.conf file and restarted radius process
> and it looks like it's not catching up from the point before restart.
> Instead of that it's reading full detail.work file? why is like that?
> Any bug in my code?

No, that's what it's supposed to do - finish detail.work, delete it and
then copy detail to detail.work etc.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Alan Buxey
Hi,
> Thanks Ivan for quick responses.
> I calculated it correctly in dialup.conf file and restarted radius process
> and it looks like it's not catching up from the point before restart.
> Instead of that it's reading full detail.work file? why is like that?
> Any bug in my code?

as it currently stands, if you quit then it'll start reading
the detail.work from the very beginning - there is no tail/stripping or
checkpointing of the file.  it'd be good for such feature to be added
at some point (i dont have time to dig/fix it)

alan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread ramesh p
Thanks Ivan for quick responses.
I calculated it correctly in dialup.conf file and restarted radius process
and it looks like it's not catching up from the point before restart.
Instead of that it's reading full detail.work file? why is like that?
Any bug in my code?

Thanks,
Rams.


> How to interpret AcctStopDelay filed?

It's the delay in seconds.

> Is there any SQL query readily
> available to update acctstoptimes correctly in FR? please suggest.

You subtract the delay from the time. For MySQL:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

Ivan Kalik
Kalik Informatika ISP
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread Ivan Kalik
> How to interpret AcctStopDelay filed?

It's the delay in seconds.

> Is there any SQL query readily
> available to update acctstoptimes correctly in FR? please suggest.

You subtract the delay from the time. For MySQL:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-09-01 Thread ramesh p
How to interpret AcctStopDelay filed?  Is there any SQL query readily
available to update acctstoptimes correctly in FR? please suggest.

> I'm using freeradius2.1.6 with buffered-sql , detail files for accounting.
> In accounting queries i observed acctstoptime = %S.
> my db some how freezed and radius stopped updating packets from
> detail.wotk
> file. When restarted it started updating but updating the packets with new
> timestamps instead of old timestmaps whatever in detail.work file. How to
> overcome this? please suggest.

Timestamps for Accounting-Start-Time and Accounting-Stop-Time will be
"wrong" but you should have delay times logged on the same radacct line.
If your billing application can't calculate the correct time from the
timestamp and the delayyou can run a sql query in order to "correct" the
times in Accounting-Start-Time and Accounting-Stop-Time fields.

Ivan Kalik
Kalik Informatika ISP
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius2.1.6| buffered-sql | acctstoptime problems

2009-08-31 Thread Ivan Kalik
> I'm using freeradius2.1.6 with buffered-sql , detail files for accounting.
> In accounting queries i observed acctstoptime = %S.
> my db some how freezed and radius stopped updating packets from
> detail.wotk
> file. When restarted it started updating but updating the packets with new
> timestamps instead of old timestmaps whatever in detail.work file. How to
> overcome this? please suggest.

Timestamps for Accounting-Start-Time and Accounting-Stop-Time will be
"wrong" but you should have delay times logged on the same radacct line.
If your billing application can't calculate the correct time from the
timestamp and the delayyou can run a sql query in order to "correct" the
times in Accounting-Start-Time and Accounting-Stop-Time fields.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html