Large multiple "if" optimisation

Jonathan Gazeley Jonathan.Gazeley at bristol.ac.uk
Thu Nov 21 12:29:13 CET 2013


On 20/11/13 17:33, Phil Mayers wrote:
> On 20/11/13 16:57, Jonathan Gazeley wrote:
>
>> It's getting a bit unwieldy to manage this block, so I'm looking for a
>> better way of writing it. However it must be fast, as every eduroam user
>> hits this, i.e. database lookups are unsatisfactory. Flat files might be
>
> Shrug. We do a database lookup on source MAC, cached in an rlm_cache 
> instance. It works fine. Get a faster database!
The database is nice and sporty and there are no particular problems 
with it. Rather, after the recent discussions on this list about how 
easily queues can back up when packet processing is even slightly slow. 
I don't want to add any unnecessary opportunities for external blocking. 
AD/NTLM is enough of a headache on its own ;)
>
>> ok depending on how they cached.
>
> A "files" module is loaded into RAM and keyed into a hash table. It'll 
> be lightning fast. Something like this:

Lightning fast.. good to know. Thanks.

>
>
>
> However a "files" module is only reloaded on hup. If you want proper 
> dynamism, use an SQL lookup and wrap it in rlm_cache e.g.
>

Ah, I wasn't aware that caching could be used with SQL. This sounds like 
a good solution.

Thanks for your advice,
Jonathan


More information about the Freeradius-Users mailing list