Mysql radius.radacct trying to clean up

Jonathan Gazeley Jonathan.Gazeley at bristol.ac.uk
Wed Nov 18 16:13:07 CET 2015


Hi Sophie,

If an Accounting-Stop record comes in and the Accounting-Start record 
can't be found, it just inserts the Accounting-Stop record anyway.

For what it's worth, we have a daily cron job that runs this SQL query 
to clear rows older than 3 months out from radius.radacct so it never 
gets too big. We don't stop/start radiusd when doing this.

delete from radius.radacct where acctstoptime < date_sub(now(), interval 
3 month);

If your table has already reached 11 million rows then that giant query 
might take a long time to complete depending on the speed of your 
database server so you might prefer to delete old rows manually in 
batches to begin with (use the LIMIT keyword in your query), and then 
enable the cron job. Or just truncate the table, as you suggested.

Cheers,
Jonathan


On 18/11/15 15:02, Sophie Loewenthal wrote:
> Hi,
>
>     Our radacct table in mysql  reached 11 million rows and we don't 
> need this information.
>
> Would it be safe if I
>     stopped FreeRadius,
>     mysql:  truncate radius.radacct;
>     started FreeRadius?
>
> How would this affect the active sessions with Radius (e.g those who 
> had accounting records sent back after the table had been truncated )?
>
> Versions:
> freeradius-mysql-2.1.12-1.el6.x86_64
> freeradius-utils-2.1.12-1.el6.x86_64
> freeradius-2.1.12-1.el6.x86_64
>
>
> Kind regards,
> Sophie
>
>
> -
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html



More information about the Freeradius-Users mailing list