Request throttling

Arran Cudbard-Bell a.cudbardb at freeradius.org
Thu Jul 2 16:06:48 CEST 2015


> On 2 Jul 2015, at 09:47, srithar jeevadurai <srijeevadurai1 at gmail.com> wrote:
> 
> Dear Friends,
> 
> Can we do throttling of no of request in process queue at freeRadius?
> 
> FreeRadius is depending on mysql, if mysql db connectivity is down for some
> time then GGSN will feed freeRadius.

If the database is down adjust the query and connection timeouts to ensure the worker threads don't block for an excessively long period.


> Radius server may run into the 'child hung' issue then we need to restart
> freeRadius.
> 
> To avoid child hung and restart of system. Can we do following?

If you're dealing with traffic spikes:

Determine the optimal number of parallel inserts.

Set the max connections in the SQL pool to be that number.

Use a detail writer/reader to insert the excesss requests into a file based queue.

accounting {
	sql {
		fail = 1
	}
	if (fail) {
		detail
	}
      }

Example of the detail reader/writer here:

	https://github.com/FreeRADIUS/freeradius-server/blob/v3.1.x/raddb/sites-available/decoupled-accounting


> 
> 1) Apply a cap on freeRadius processing queue i.e. if backlog on processing
> queue is more than 50000 request then reject requests further request until
> it comes down less than 50000.

and drop accounting data in the process?

> It will avoid child hung issue.

Probably not.

> My understanding on child hung:

Is incorrect.

> 1) If backlog is more in processing queue then it will spend time on
> processing head of the queue.
> 2) messages are reaching age limit of unattended age limit at tail of the
> queue.
> 3) Due to that child hung is happening.

Nope. It's happening because your server is performing blocking calls to an overloaded database, which are taking too long.

This would be one of the advantages to moving to an asynchronous processing model. We could set a hard coded one second query timeout, and force everyone to fix their databases.

-Arran

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20150702/ebed0b0e/attachment.sig>


More information about the Freeradius-Users mailing list