Using the authenticate function on rlm_python
Alan DeKok
aland at deployingradius.com
Fri Nov 15 12:37:43 UTC 2024
On Nov 15, 2024, at 3:28 AM, Francis Augusto Medeiros-Logeay via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> Thanks a lot, Alan. It works!
Good to hear.
> I was wondering if there’s any example on how to handle threads here.
No. The server has it's own thread pool. You shouldn't start new threads in Python.
> The thing is that I’ll be using python there to handle push notifications, which might be blocking. I’m not being able to have concurrent authentication requests. according to the documentation, threading seems to be supported, but I can’t figure out how.
If the API is blocking, there is very little you can do to fix that. The server *must* wait for the reply, which means... waiting for the reply.
The only solution here for v3 is to increase the number of threads in radiusd.conf. See "thread pool". Set the maximum to a large number, like 100, or even more if you need it. The only negative side effect is that the server will use more memory.
One of the large delays in v4 is changing the entire model to non-blocking. The Python module doesn't yet support it, but the rest of the server does. This increases performance quite a bit.
Alan DeKok.
More information about the Freeradius-Users
mailing list