Thanks & question

Alan DeKok aland at
Tue Apr 20 16:20:46 CEST 2021

On Apr 20, 2021, at 9:52 AM, mohamed almeshal <mohammed.almeshal at> wrote:
> it's fixed I manage to fix it and handle the inbounds traffics , Sorry For My Miss understand .

  That's good.

> Now I have 2 questions :
> First :
> is it best practice to implement SQL query for billing purpose in sites-available "default" file or it must be handle
> By another ways .

  I don't know what that means.

  The default SQL configuration puts enough information into SQL that ISPs can do billing.

> I'm struggle with stale session due to huge load , I usually clear it by cron jop or by SQL query that close the session if the user is try to login with open session it's works but not that clever ?
> my questions is what is the best practice to handle stale session ?

  Stale sessions are generally a result of the NAS not sending accounting data to the server.  This is bad.

  The server doesn't remove "old" sessions for users by default.  This is because we have no idea what an "old" session is.  We can guess, but there are so many different RADIUS systems that anything which works in one place won't work elsewhere.

  You can write an SQL query which runs periodically to delete sessions which you know are stale.  The only thing to remember is that this deletion should be fast.  i.e. don't delete 100K sessions every 10 minutes.  The SQL server will block.  Instead, delete a small number of sessions much more often.

  I don't see why "huge load" is an issue.  Any default install should be able to handle at least a few hundred accounting packets a second to SQL.  If you're getting a lot more than that, then you need to spend a fair amount of effort understanding it and creating a custom solution.

  i.e. for an ISP with 10K users, the default install is fine.  For an ISP with 100K+ users, you really need a dedicated expert who has a deep understanding of RADIUS and SQL.

  Alan DeKok.

More information about the Freeradius-Users mailing list