Using different MySQL server with freeradius 3.x ?

Alan DeKok aland at deployingradius.com
Tue Feb 27 15:52:32 CET 2018


On Feb 26, 2018, at 9:43 PM, philippe2.legoff at 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.




More information about the Freeradius-Users mailing list