Acounting problem with SQL and detail files

Alan DeKok aland at deployingradius.com
Wed Feb 12 15:43:58 CET 2014


Aurélien Lafranchise wrote:
> I am looking for redundancy, if SQL does not work I can count on detail files.

  The problem is that "not working" is VERY different from "working and
doing bad things".

> If the SQL problem blocks the whole FreeRADIUS server I think there is a problem of design 

  Don't be rude.  Since you don't understand how the system works, you
shouldn't be pointing out deficiencies in the design.

  How do *you* propose to make the server "work properly" when the SQL
server takes forever to respond to a query?  You have the following problem:

- FreeRADIUS uses SQL to store data
- FreeRADIUS receives 1000 accounting packets/s
- FreeRADIUS has 100 threads
- each SQL INSERT takes 2000 seconds to finish

  So... the first 100 packets received are inserted into SQL.  And 2000
seconds later, the threads are free to process another request.  During
that time, the NAS sent another 2000000 requests.

  Maybe you try to solve the problem by adding more threads.  Can your
system handle 2000000 threads?  No?  You should start blaming the OS!
Stupid Linux people can't even write a real OS...

  The problem is that there is no SQL API to say "stop after 2 seconds"
There is no API to stop a long-running SQL query.

  If you need to write data to SQL and your SQL server doesn't work,
you're *stuck*.  There is NOTHING MORE YOU CAN DO.

> You may answer "work-as-design", but could you confirm?

  You're asking the wrong (and rude) question.  We didn't design the
server to block.  We designed the server to use existing APIs.

  So... we're bound by the limitations of those APIs.

> Why there is no protection against blocked SQL server to let FreeRADIUS process queries ?

  Because the SQL libraries we use don't allow that.

> Considering that, would you advise another configuration?

  Fix your SQL server.  I think I mentioned that.

  Could you explain in little words why you're blaming FreeRADIUS, when
I told you very specifically that the SQL server is to blame?

  I *could* give you a configuration which may work around some of these
issues.  I did, in fact... see raddb/sites-available/.  But that won't
solve the problem.  It will just hide it for a short while.

  And 20 minutes later, the system will go down because the detail files
filled the disk, and you'll be back here.  Blaming FreeRADIUS.

  I find this attitude *very* annoying.  You're unwilling to fix your
broken system.  Instead, you're insulting me and saying I should do the
impossible.  Because you don't understand how things work.

  That's annoying.

  Alan DeKok.


More information about the Freeradius-Users mailing list