thread pool and requests queueing

Eugene Grosbein fr at grosbein.net
Fri Apr 11 12:04:09 CEST 2014


Hi!

What may be a reason for freeradius idle thread does not processing
new request from the queue immediately?

thread pool {
        start_servers = 256
        max_servers = 256
        min_spare_servers = 256
        max_spare_servers = 256
        max_queue_size = 262144
        max_requests_per_server = 0
}

As you see, I have lots of threads and my logs show they are mostly idle
(each thread logs its internal OS pthread id when post_auth is started).

However, this what happens here:

1. freeradius obtains new request R and successfully queues it.
I added radlog() call to event.c, received_request() just before "return 1;"
to make sure.

2. Eventually, some thread starts to process this request but between moment 1
and this moment this thread processes 2-3 another requests. So, the request R
was waiting in the queue meantime in spite of presence many other idle threads.

This is big problem for us as sometimes my perl code NEEDS to insert
2 seconds delay before it returns RLM_MODULE_NOTFOUND to the dhcp module
so that DHCPNAK is sent with 2 seconds delay. This way we keep broken DHCP clients
from abusing our DHCP relays with tons of requests per second.

These broken clients keep repeating DHCPDISCOVER/DHCPREQUEST
at high rate if they get DHCPNAK quickly and we cannot get rid of them all.
With this delay, they patiently wait for answer this giving us
some kind of "request throttling".

How can I force radiusd to use some idle thread at once to minimize queueing delay?

Eugene 


More information about the Freeradius-Users mailing list