Acct-Delay-Time attribute in buffered-sql server mode

Rygl Aleš ales at rygl.net
Sat Oct 4 08:51:42 CEST 2014


Hi all,

I have found an interesting issue related to Acct-Delay-Time attribute when 
buffered-sql mode is in use. I am not sure if it is a bug or feature. IMHO it 
is a bug but I would like to discuss it here.

I am using freeradius for accounting in buffered-sql mode with MySQL backend. 
The main radacct table is using memory engine so it is pretty fast 
nevertheless the buffered-sql mode is a must. We have more 1.000 Acct req/sec 
in average with additional repeated peaks. We need to store the Acct-Delay-
Time for diagnostic purposes. It is not always present in the Accounting 
request from NAS but if it is there it indicates that NAS is experiencing some 
performance problems. 

And the issue is that even if there is no Acct-Delay-Time received from the 
NAS, it appears in radacct table then and from my observations it has nothing 
to do with the real delay of the session start and indicates just the amount 
of time for which the record was waiting in radacct/detail.work file. IMHO this 
is wrong because the SQL scripts in dialup.conf are doing a correction of 
session start time based using Acct-Delay-Time.

My accounting-start-query:

accounting_start_query = "INSERT into ${acct_table1} (AcctUpdateTime, 
AcctSessionId, AcctUniqueId, UserName, NASIPAddress, AcctStartTime, 
AcctSessionTime, AcctAuthentic, AcctInputOctets, AcctOutputOctets, 
CalledStationId, CallingStationId, AcctTerminateCause, FramedIPAddress, 
AcctStartDelay, AcctStopDelay, SgsnIpAddr, Imsi, 3GPPSelectionMode, 
3GPPGPRSNegotiatedQoSProfile, Acct_Status_Type, 3GPPChargingId, 3GPPNSAPI, 
3GPPSGSNMNCMCC, 3GPPRATType, 3GPPUserLocationInfo, 3GPPMSTimezone, 3GPPIMEISV, 
TMOChargingRuleBaseName, SNVirtualAPNName, SNRulebase) values('%S', '%{Acct-
Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{NAS-IP-
Address}', DATE_SUB('%S', INTERVAL %{Acct-Delay-Time:-0} SECOND), '0', 
'%{Acct-Authentic}', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-
Id}', '', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0','%{3GPP-SGSN-
Address}','%{3GPP-IMSI}','%{3GPP-Selection-Mode}','%{3GPP-GPRS-Negotiated-QoS-
profile}','%{Acct-Status-Type}','%{3GPP-Charging-ID}','%{3GPP-NSAPI}','%{3GPP-
SGSN-MCC-MNC}','%{3GPP-RAT-Type}','%{3GPP-Location-Info}','%{3GPP-MS-Time-
Zone}','%{3GPP-IMEISV}','%{TMO-Charging-Rule-Base-Name}','%{SN-Virtual-APN-
Name}','%{SN-Rulebase}')"


I always thought buffered-sql server is just a loader of the detail file to db. 
But it looks like it is working as a real radius server manipulating the  
Acct-Delay-Time attribute which is IMHO wrong here and should be suppressed 
somehow. What is your opinion?

I am running Debian 7.2, freeradius 2.1.12, kernel 3.2.0-4-amd64

Regards
Ales
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20141004/4946c247/attachment.html>


More information about the Freeradius-Users mailing list