On 04.04.2014 22:44, Alan DeKok wrote:
Let me go further...
My guess is that you're using MySQL to store IPs. You're using a "SELECT FOR UPDATE ... LIMIT 1" query to grab the IP.
That's the problem. MySQL will lock all of the rows SELECTed, even if you say LIMIT 1. The result is massive lock contention, and MySQL will take many seconds to respond.
Use a real database, like PostgreSQL. The problem will go away.
We do not use MySQL or SELECT FOR UPDATE. We use MS SQL and stored procedures there and when hundreds of simultaneous requests come from _distinct_ MAC addresses without using DHCP relays, then FreeRADIUS processes them instantly. But when DHCP relay stays in front of FreeRADIUS, request drops and bad queueing happen due to wrong assumptions in its code that looks for duplicates in the queue of requests. These assumptions are just fine for RADIUS protocol and they are fine for DHCP without relays but they are plain wrong when all DHCP requests come from single MAC address of DHCP relay.