Freeradius 3.0.7 and multiple buffered-sql servers - detail file issues
Rygl Aleš
ales at rygl.net
Thu Apr 16 20:44:06 CEST 2015
Hello all.
I am trying to migrate the freeradius 2.2.5 to 3.0.7. The server is doing just Acounting request processing and is loading requests to MariaDB with radacct table on InnoDB engine allowing row level locking. There are 128 detail files derived from Calling-Station-Id attribute using mod 128:
Queue-Number = "%{expr: %{Calling-Station-Id} %% 128 }"
detailfile = ${radacctdir}/detail.mobile/queue-${Queue-Number}/detail-%Y%m%d-%H
Then there are 128 buffered-sql servers reading these detail files and feeding the radacct table:
server buffered-sql-0 {
listen {
type = detail
filename = "${radacctdir}/detail.mobile/queue-0/detail-*"
load_factor = 85
track = yes
poll_interval = 5
retry_interval = 30
}
preacct {
acct_unique
}
accounting {
sql
if (noop) {
ok
}
}
}
.
.
.
server buffered-sql-127 {
listen {
type = detail
filename = "${radacctdir}/detail.mobile/queue-127/detail-*"
load_factor = 85
track = yes
poll_interval = 5
retry_interval = 30
}
preacct {
acct_unique
}
accounting {
sql
if (noop) {
ok
}
}
}
This setup is working fine with 2.2.5 version and is very fast. I am able to process more that 1.500 Acct req/s realtime. When I try to use 3.0.7, I am facing some issues:
1. Bad file descriptor message. Looks like it is caused by track = yes config option. When switched to no, it dissapears. What is the problem here?
Thu Apr 16 15:58:52 2015 : Warning: Failed marking detail request as done: Bad file descriptor
Thu Apr 16 15:58:52 2015 : Warning: Failed marking detail request as done: Bad file descriptor
Thu Apr 16 15:58:52 2015 : Warning: Failed marking detail request as done: Bad file descriptor
2. When the server is loaded with ~350 req/s, it is ok. When the load is ~1500 req/s, I can see tons of errors in the log file:
Thu Apr 16 16:24:38 2015 : ERROR: (585809) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-58/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585810) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-28/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585811) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-122/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585812) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-102/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585813) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-10/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585814) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-118/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585815) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-0/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585816) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-36/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585817) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-0/detail-2015041616: Too many different filenames
Thu Apr 16 16:24:38 2015 : ERROR: (585818) detail.mobile: ERROR: Couldn't open file /var/log/freeradius/radacct/detail.mobile/queue-32/detail-2015041616: Too many different filename
The config:
sites-enabled/acct_detail
server acct.mobile {
listen {
ipaddr = *
port = 2813
type = acct
limit {
}
}
preacct {
preprocess
acct_unique_mobile
}
accounting {
detail.mobile
if (noop) {
ok
}
}
}
sites-enabled/buffered-sql-mobile-0
server buffered-sql-0 {
listen {
type = detail
filename = "${radacctdir}/detail.mobile/queue-0/detail-*"
load_factor = 85
track = no
poll_interval = 5
retry_interval = 120
}
preacct {
}
accounting {
sql_instance_mobile
if (noop) {
ok
}
}
}
mods-enabled/detail.mobile
detail detail.mobile {
Queue-Number = "%{expr: %{Calling-Station-Id} %% 128 }"
filename = ${radacctdir}/detail.mobile/queue-${Queue-Number}/detail-%Y%m%d%H
locking = yes
}
./mods-available/sql_ar
sql sql_instance_mobile {
driver = "rlm_sql_mysql"
dialect = "mysql"
server = "localhost"
port = 3306
login = "radius"
password = "xxxxxxxxxxxxxxx"
radius_db = "gprscalls"
acct_table1 = "radacct_test"
acct_table2 = "radacct_test"
postauth_table = "radpostauth"
authcheck_table = "radcheck"
groupcheck_table = "radgroupcheck"
authreply_table = "radreply"
groupreply_table = "radgroupreply"
usergroup_table = "radusergroup"
delete_stale_sessions = yes
logfile = ${logdir}/sqllog_mobile.sql
pool {
start = 128
min = 128
# max = ${thread[pool].max_servers}
max = 128
spare = 5
uses = 0
lifetime = 0
idle_timeout = 60
}
client_table = "nas"
$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries_mobile.conf
}
radiusd.conf
prefix = /usr
exec_prefix = /usr
sysconfdir = /etc
localstatedir = /var
sbindir = ${exec_prefix}/sbin
logdir = /var/log/freeradius
raddbdir = /etc/freeradius
radacctdir = ${logdir}/radacct
name = freeradius
confdir = ${raddbdir}
modconfdir = ${confdir}/mods-config
certdir = ${confdir}/certs
cadir = ${confdir}/certs
run_dir = ${localstatedir}/run/${name}
db_dir = ${raddbdir}
libdir = /usr/lib/freeradius
pidfile = ${run_dir}/${name}.pid
max_request_time = 10
cleanup_delay = 5
max_requests = 20000
hostname_lookups = no
log {
destination = files
colourise = yes
file = ${logdir}/radius.log
syslog_facility = daemon
stripped_names = no
auth = no
auth_badpass = no
auth_goodpass = no
msg_denied = "You are already logged in - access denied"
}
checkrad = ${sbindir}/checkrad
security {
user = freerad
group = freerad
allow_core_dumps = no
max_attributes = 200
reject_delay = 1
status_server = yes
allow_vulnerable_openssl = 'CVE-2014-0160'
}
$INCLUDE clients.conf
thread pool {
start_servers = 512
max_servers = 2000
min_spare_servers = 100
max_spare_servers = 300
max_requests_per_server = 0
auto_limit_acct = no
}
modules {
$INCLUDE mods-enabled/
}
instantiate {
}
policy {
$INCLUDE policy.d/
}
$INCLUDE sites-enabled/
Thanks
With regards
Ales
More information about the Freeradius-Users
mailing list