recommendations for max_servers

Alan DeKok aland at deployingradius.com
Sat Sep 20 00:52:09 CEST 2014


Louis Munro wrote:
> While troubleshooting a system I came upon a case of 'hung children' and
> duplicate requests. 

  So... something is blocking the server.  Find out what that is, and
fix it.

> On the other hand the max_servers setting had been set as high as 192 by
> someone with good intentions. 
> Tuning it down to 64 seemed to significantly reduce the load on the
> system and the number of hung children was reduced by a factor of about
> 100. 

  Adding more threads results in more contention, and more problems.
The child threads get hung because they're blocked.  Adding more child
threads means more blocking.

  Playing games with max_servers won't help.  The *only* solution is to
find the root cause of the problem, and then fix it.

> While there remains an issue with some (intermittent) slow ntlm_auth to
> take care of, I wondered how others tune the value of max_servers other
> than by trial and error. Most of the time the default of 32 has been
> enough for me. Higher is not necessarily better in my experience since
> at least in this case it seems to have led to the main thread working
> harder when under load (with most of the work done in the "system" space). 

  If the threads aren't blocked, you can set max_servers to 10000, and
it won't cause a problem.

> This is a system running 2.2.5 on RHEL 6.4 in VmWare. It's got 24Gb of
> RAM and 16 cores so it should still be pretty capable. 

  Except for the fact that it spends most of it's time in kernel space.
 So the RADIUS process isn't really doing much.

> Does anyone have an algorithm, rule of thumb or other ballpark way of
> estimating the "ideal" maximum number of threads? 

  Fix the blocking issue.  Then, set max_servers to some huge number.

  Alan DeKok.


More information about the Freeradius-Users mailing list