Python Module Threading Issue

Kwak Wookjong wookjong.kwak at
Thu Sep 5 23:07:14 CEST 2019

Hi Alan,

I recently upgraded FreeRadius server 3.0.16 to 3.0.19 and observed a performance issue on handling multiple thread.

I have done some research on this forum and found below discussion for Python Module Threading Issue about a year ago.<>

As a result of the discussion, it made one of the configuration value changed in rlm_python/rlm_pyton.c (line #1180) for 3.0.18 release.<>
module_t rlm_python = {
               .magic                  = RLM_MODULE_INIT,
               .name                   = "python",
-              .type                     = RLM_TYPE_THREAD_SAFE,
+             .type                     = RLM_TYPE_THREAD_UNSAFE,

and it looked like the change was made in case for using multiple python modules but the thing is,
in my case, within a single python module the multiple requests were treated as a single threaded.

I have confirmed such behavior with a simple test with using python module and example code provided in /etc/raddb/mods-config/python/
by putting few seconds of delay for authenticate.

def authenticate(p):
  print "*** authenticate ***"
  return radiusd.RLM_MODULE_OK

Also confirmed, by putting back RLM_TYPE_THREAD_SAFE, multiple requests were handled by multi-threaded and the performance issue was resolved.

If it were needed to update RLM_TYPE_THREAD_UNSAFE for using multiple python module,
Can you, at least, make it configurable so that it can be set depending on the usage and situation?

Let me know,


Best Regards,

This message and any attachments are intended solely for the addressees and may contain confidential information. Any unauthorized use or disclosure, either whole or partial, is prohibited.
E-mails are susceptible to alteration. Our company shall not be liable for the message if altered, changed or falsified. If you are not the intended recipient of this message, please delete it and notify the sender.
Although all reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus.

More information about the Freeradius-Users mailing list