<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi all,</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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. </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">My accounting-start-query:</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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}')"</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a name="result_box"></a>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?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I am running Debian 7.2, freeradius 2.1.12, kernel 3.2.0-4-amd64</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Regards</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Ales</p></body></html>