Tuning freeradius memory usage for small footprint machines

Alan DeKok aland at deployingradius.com
Mon May 27 14:49:10 UTC 2024


On May 24, 2024, at 9:46 PM, Peter Thomas (pethoma2) via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> 
> Thanks for the responses. I did some digging around and this is what I found.
> 
> While running by disabling threads (-t) freeradius uses around 5MB while the normal mode uses about 43MB. In normal mode, freeradius seems to use a min of 9 threads even if I use extremely conservative server settings like start_servers = 1 max_servers = 1 min_spare_servers = 0 max_spare_servers = 0

  The large memory block is due to the atomic queues.  You can disable that by editing src/main/threads.c:

...
// add the next line
#undef HAVE_STDATOMIC_H

#ifdef HAVE_STDATOMIC_H
#include <freeradius-devel/atomic_queue.h>
#endif
...

  That should lower memory usage.

  As for starting 9 threads, nope.  That might be an OS / libc thing.  FreeRADIUS only starts the number of threads you tell it to.

  Alan DeKok.



More information about the Freeradius-Users mailing list