Using different MySQL server with freeradius 3.x ?
Hello, With Freeradius 3.0.16, I store accountings in a MySQL 5.7 database. Authorize_checks and replies are also using this db. As I receive more than 3000 accountings/sec, I search a way to reduce the load on the db. 1/ Does it possible to use different MySQL servers to store accountings depending on the Framed-IP-Address ? As an example, could I have this logic with FR : If Framed-IP-Address starts with “10” Then use the MySQL1 server and store accounting on it, If Framed-IP-Address starts with “171” then use the MySQL2 server and store accounting on it Etc.. 2/ Another point concerns the log. I have a huge quantity of lines in radius.log : Info: [sql] stop packet with zero session length…. Does it exist a way to drop silently these lines ? Thanks for help, Regards, Philippe _________________________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.
Hi philippe, Read about sharding in mysql. This will answer your 1st question. 2/ reduce log level will result less logging and avoid CPU overheads. Also use logrotate to recover your disk space. On Tue, 27 Feb 2018 7:43 am , <philippe2.legoff@orange.com> wrote:
Hello,
With Freeradius 3.0.16, I store accountings in a MySQL 5.7 database. Authorize_checks and replies are also using this db. As I receive more than 3000 accountings/sec, I search a way to reduce the load on the db.
1/ Does it possible to use different MySQL servers to store accountings depending on the Framed-IP-Address ? As an example, could I have this logic with FR : If Framed-IP-Address starts with “10” Then use the MySQL1 server and store accounting on it, If Framed-IP-Address starts with “171” then use the MySQL2 server and store accounting on it Etc..
2/ Another point concerns the log. I have a huge quantity of lines in radius.log : Info: [sql] stop packet with zero session length….
Does it exist a way to drop silently these lines ?
Thanks for help, Regards, Philippe
_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Tue, Feb 27, 2018 at 9:43 AM, <philippe2.legoff@orange.com> wrote:
Hello,
With Freeradius 3.0.16, I store accountings in a MySQL 5.7 database. Authorize_checks and replies are also using this db. As I receive more than 3000 accountings/sec, I search a way to reduce the load on the db.
There are ways to handle that. My question, however, are those accounting requests absolutely necessary? Are you perhaps setting interim update time too low?
1/ Does it possible to use different MySQL servers to store accountings depending on the Framed-IP-Address ? As an example, could I have this logic with FR : If Framed-IP-Address starts with “10” Then use the MySQL1 server and store accounting on it, If Framed-IP-Address starts with “171” then use the MySQL2 server and store accounting on it Etc..
Try http://freeradius.org/radiusd/man/unlang.html You should be able to configure several instances on sql module, and call the appropriate one based on criteria of your choice (e.g. Framed-IP-Address) -- Fajar
On Feb 26, 2018, at 9:43 PM, philippe2.legoff@orange.com wrote:
With Freeradius 3.0.16, I store accountings in a MySQL 5.7 database. Authorize_checks and replies are also using this db. As I receive more than 3000 accountings/sec, I search a way to reduce the load on the db.
The main way to make DBs faster is to (a) not use the DB, or (b) batch up insertions, or (c) shard the data across multiple DBs.
1/ Does it possible to use different MySQL servers to store accountings depending on the Framed-IP-Address ? As an example, could I have this logic with FR : If Framed-IP-Address starts with “10” Then use the MySQL1 server and store accounting on it, If Framed-IP-Address starts with “171” then use the MySQL2 server and store accounting on it
Yes. if (Framed-IP-Address < 10/8) { sql1 } elsif (Framed-IP-Address < 171/8) { sql2 }
Etc..
2/ Another point concerns the log. I have a huge quantity of lines in radius.log : Info: [sql] stop packet with zero session length….
Does it exist a way to drop silently these lines ?
Yes. At the top of the "accounting" section, do: if (Acct-Session-Time == 0) { ok return } Though if you're running 3.0.16, that message doesn't appear in the source or in the logs. Are you sure that you don't gave two copies of FreeRADIUS installed? i.e. one which is v2, and another v3? Alan DeKok.
participants (4)
-
Abdul Basit -
Alan DeKok -
Fajar A. Nugraha -
philippe2.legoff@orange.com