On 27/02/18 14:09, Alan DeKok wrote:
Use the native DB query functions in FreeRADIUS. It's MUCH faster that way.
i.e. do any and all DB queries via "update" sections, and assign the values to temporary attributes. Then, run the *logic* in Python. i.e. have the python code do if / then / else checks, but don't have it to DB connectivity.
And if you're sending email, you're MUCH better off doing that out of band. i.e. have FR write the information to a file / DB, etc. Then, another process can read that file and send the email.
Hi, I have looked into our current script and ascertained that the vast majority of auth requests can be handled by a single SELECT query and some logic in perl. It is (essentially) only when we see a device for the first time that we need to update database tables and send emails. I imagine that it will be easy enough to create a non-blocking mechanism for sending email, but out of interest, if we use perl, would it be such a big problem to send mail from the perl script given that the perl interpreter is threaded? As for the database updates I think we can take the performance hit of running them from within the script as they are infrequent - I don't have a metric immediately to hand but one every few minutes sounds about right. Or would you still strongly recommend making these DB updates "native" as well? thanks dom